{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Необходимо составить расписание работы врачей-рентгенологов. План составляется на месяц вперед. Делим весь горизонт планирования на интервали по 4 часа. Сутки начинаются в 00:00. Заданы недельные планы по выполнения анализов. Если включена часть недели в горизонт планирования, то делим пропорцианально."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Предобработка:**\n",
    "\n",
    "Входные данные должны мыть представлены в определенном виде."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Входные данные:**\n",
    "\n",
    "(x) Задан датафрейм интервалов доступности (0/1/-1). 0 - врач может работать в данный интервал времени, -1 - точно нет (отпуск), 1 - обязательно да.\n",
    "\n",
    "*как я понял, это учет пожеланий врачей по работе и отпуску, сейчас этой инфы нет, нагенерировать супер адекватно не получится, сделаю как нибудь*\n",
    "\n",
    "\n",
    "(!) Для каждого врача определены специализации. Первое значение (id 0) - номер основной специализации, далее массив 0\\1. 1 - врач работает по этой специализации, 0 - нет. Например, [3 0 1 1 1 0], 3 - основная\n",
    "\n",
    "\n",
    "\n",
    "*окей, в добавок еще дам коммент какая специалзация имеет какой номер* Сделать так, чтобы было датафреймом\n",
    "\n",
    "(x) Массив со ставками врачей от 0.1 до 1\n",
    "\n",
    "*ок*\n",
    "\n",
    "(x) Датафрейм 0\\1 с информацией о ночных/праздничных/выходных интервалах. 0 - обычный рабочий день, 1 - нет.\n",
    "\n",
    "*тоже без проблем, посмотрю трудовой календарь*\n",
    "\n",
    "(?) Массив с инфой о количестве отработтынх часов для первой неполной рабочей недели.\n",
    "\n",
    "*это что то типо того, когда у нас месяц начинается не с понедельника? типо хвост с предыдущего предсказания. Хз как мне это сгенерировать*\n",
    "\n",
    "(?) Массив с инфой были ли уже выходые. 1 - да, 0 - нет.\n",
    "\n",
    "*У всех когда то были выходные, верну массив ones*\n",
    "\n",
    "(x) Массив с инфой о согласии на работу ночью/дежурства 0/1.  1 - врач согласен, 0 - врач не согласен.\n",
    "\n",
    "*Генерируем случайно с p и q*\n",
    "\n",
    "(x) Датафрейм с инфой о возможном количестве (мин - макс) проводимых анализов каждого типа\n",
    "\n",
    "*из норматив вытащу*\n",
    "\n",
    "(x) Массив с инфой о базовом виде графика. 8/1, 12/2, 24/3. Возможные значения: 2/3/6 (продолжительность в интервалах по 4 часа)\n",
    "\n",
    "*не совсем понял, посмотрю в ТК рф и добавлю*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "все в датафрейм, что относится к врачам вместе\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Выходные данные:**\n",
    "\n",
    "Для каждого врача бинарный массив (одинаковой длины для всех), в виде датафрейма. 1 - врач работает в данный интервал времени, 0 - нет, -1 - отпуск или подобное."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Постобработка:**\n",
    "\n",
    "Заполнить табель\n",
    "\n",
    "Посчитать мин и макс значены выполняемых анализов по неделям"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Ограничения:**\n",
    "\n",
    "1) в каждый интевал (по 4 часа) врач выполняет только один вид анализов\n",
    "\n",
    "2) врачи ывполняют анализы только своих спциальностей\n",
    "\n",
    "3) в каждыую неделю все анализы выполнены\n",
    "\n",
    "4) смены непрерывны\n",
    "\n",
    "5) между сменами есть отдых. Для 2 интервалов - мин 3 интервала (база - 4), Для 3 интервалов - мин 6 интервала (база - 9), Для 6 интервалов - мин 9 интервала (база - 12)\n",
    "\n",
    "7) каждую неделю минимум 48 часов непрерывного отдыха.\n",
    "\n",
    "8) в каждую смену не больше X врачей работает, не больше X/4 в выходные и праздники. Подберем эксперементально. Нужно для равномерного распределения"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**ЦФ:**\n",
    "\n",
    "1) Минимизация отклонений от базовых графиков\n",
    "2) минимизация ночных/праздничных смен"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import numpy.typing as npt\n",
    "import holidays"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [],
   "source": [
    "class DataDoctors:\n",
    "    \"\"\"\n",
    "    Создаем некоторую структуру, которая содержит все данные\n",
    "    \n",
    "    4 датафрейма\n",
    "    1 - интервал доступности availability_interval\n",
    "    \n",
    "    2 - нормативы для операций normatives\n",
    "    \n",
    "    3 - особенности врачей (ставка)\n",
    "    \n",
    "    4 - часть предыдущего решения\n",
    "    \n",
    "    5 - Series с информацией о выходных\n",
    "    \"\"\"\n",
    "    def __init__(self, doctors: int):\n",
    "        \"\"\"\n",
    "        Все устанавливается на None\n",
    "        а птом генерируется \n",
    "        \"\"\"\n",
    "        self.doctors = doctors\n",
    "        \n",
    "        self.availability_interval = None\n",
    "        \n",
    "        self.normatives = None\n",
    "        \n",
    "        self.docs = None\n",
    "        self.employee_rate = None\n",
    "        self.spec = None\n",
    "        self.night_duty = None\n",
    "        self.individual_graph = None\n",
    "        \n",
    "        self.solution_tale = None\n",
    "        self.hours_worked = None\n",
    "        self.rest = None\n",
    "        \n",
    "        self.holiday_date = None        \n",
    "        \n",
    "        \n",
    "    def gen_docs(\n",
    "        self,\n",
    "        doctors: int,\n",
    "        employee_rate = None,\n",
    "        spec = None\n",
    "    ) -> None:\n",
    "        self.employee_rate = employee_rate\n",
    "        self.spec = spec\n",
    "        if employee_rate is None:\n",
    "            self.gen_employee_rate(doctors)\n",
    "        if spec is None:\n",
    "            self.gen_spec(doctors)\n",
    "        self.gen_night_duty(doctors)\n",
    "        self.gen_individual_graph(doctors)\n",
    "        \n",
    "        df = pd.DataFrame(self.spec, columns = ['Основа','РГ', 'ММГ', 'МРТ', 'КТ', 'ФЛГ', 'Денс'])\n",
    "        df['Ставка'] = pd.Series(self.employee_rate)\n",
    "        df['Дежурство'] = pd.Series(self.night_duty)\n",
    "        df['График'] = pd.Series(self.individual_graph)\n",
    "        \n",
    "        self.docs = df\n",
    "        \n",
    "    def gen_solution_tale (self, doctors: int) -> None:\n",
    "        self.gen_hours_worked(doctors)\n",
    "        self.gen_rest(doctors)\n",
    "        \n",
    "        df = pd.DataFrame(self.hours_worked, columns = ['Отработка'])\n",
    "        df['Отдых'] = pd.Series(self.rest)\n",
    "        \n",
    "        self.solution_tale = df\n",
    "        \n",
    "        \n",
    "    def gen_hours_worked(self, doctors: int) -> None:\n",
    "        \"\"\"\n",
    "        сколько отработал\n",
    "        \"\"\"\n",
    "        actions = [0, 8, 16, 24, 32]\n",
    "        prob =   [0.20, 0.20, 0.20, 0.20, 0.20]\n",
    "\n",
    "        self.hours_worked = np.asarray([\n",
    "            np.random.choice(actions, p=prob) for _ in range(doctors)\n",
    "        ])\n",
    "    \n",
    "    def gen_rest(self, doctors: int) -> None:\n",
    "        \"\"\"\n",
    "        были ли выходные\n",
    "        \"\"\"\n",
    "        actions = [0, 1]\n",
    "        prob =   [0.65, 0.35]\n",
    "\n",
    "        self.rest = np.asarray([\n",
    "            np.random.choice(actions, p=prob) for _ in range(doctors)\n",
    "        ])\n",
    "    \n",
    "    def gen_employee_rate(self, doctors: int) -> None:\n",
    "        \"\"\"\n",
    "        генерируем ставки случайно \n",
    "        \"\"\"\n",
    "        actions = [0.25, 0.5, 0.75, 1.]\n",
    "        prob =   [0.10, 0.30, 0.10, 0.5]\n",
    "\n",
    "\n",
    "        self.employee_rate = np.asarray([\n",
    "            np.random.choice(actions, p=prob) for _ in range(doctors)\n",
    "        ])\n",
    "        \n",
    "    def gen_spec(self, doctors: int) -> None:\n",
    "        \"\"\"\n",
    "        генерируем модальности\n",
    "        \n",
    "        (основные) РГ, ММГ, МРТ, КТ, \n",
    "        (доп) ФЛГ, Денс\n",
    "        \"\"\"\n",
    "        actions_base = [1, 2, 3, 4]\n",
    "        actions_add  = [1, 2, 3, 4, 5, 6]\n",
    "        probs_base   = [1/len(actions_base) for _ in actions_base]\n",
    "        \n",
    "        docs = []\n",
    "        \n",
    "        for d in range(doctors):\n",
    "            base_spec = np.random.choice(actions_base, p=probs_base)\n",
    "            add_spec = np.random.choice([0, 1], size=len(actions_add), p=[.6, .4])\n",
    "            add_spec[base_spec-1] = 1\n",
    "            docs.append([base_spec, *add_spec])\n",
    "        \n",
    "        self.spec = docs\n",
    "        \n",
    "        \n",
    "    def gen_night_duty(self, doctors: int) -> None:\n",
    "        \"\"\"\n",
    "        это соотносится со ставкой?\n",
    "        \"\"\"\n",
    "        self.night_duty = np.random.choice([0, 1], size=doctors, p=[.8, .2])\n",
    "\n",
    "    def gen_individual_graph(self, doctors: int) -> None:\n",
    "        \"\"\"\n",
    "        график работы\n",
    "        это соотносится со ставкой? 236 или 246\n",
    "        \"\"\"\n",
    "        self.individual_graph = np.random.choice([2, 3, 6], size=doctors, p=[.6, .2, .2])\n",
    "    \n",
    "    def gen_holiday(\n",
    "        self,\n",
    "        times_start: str,\n",
    "        times_end: str,\n",
    "    ) -> None:\n",
    "        \"\"\"\n",
    "        Тут генерируем данные в формате\n",
    "        начало 'YYYY-MM-DD', \n",
    "        конец 'YYYY-MM-DD',\n",
    "        \"\"\"\n",
    "        times = pd.date_range(\n",
    "            start=times_start,\n",
    "            end=times_end,\n",
    "            freq='4h'\n",
    "        )\n",
    "        df = pd.DataFrame(index=times)\n",
    "        df.index = pd.to_datetime(df.index)\n",
    "        hol = pd.Series(holidays.Russia(years=range(df.index.min().year,\n",
    "                                                                     df.index.max().year+1))).index\n",
    "        \n",
    "        \n",
    "        self.holiday_date = pd.Series(df.index.date).isin(hol)\n",
    "    \n",
    "    def gen_availability_interval(\n",
    "        self,\n",
    "        times_start: str,\n",
    "        times_end: str,\n",
    "        doctors: int,\n",
    "    ) -> None:\n",
    "        \"\"\"\n",
    "        Тут генерируем данные в формате\n",
    "        начало 'YYYY-MM-DD', \n",
    "        конец 'YYYY-MM-DD',\n",
    "        количество докторов\n",
    "        \n",
    "        дискретизация в 4 часа\n",
    "        \n",
    "        Нужно, чтобы соотносилось со ставками и другими пожеланиями? и праздниками?\n",
    "        \"\"\"\n",
    "        times = pd.date_range(\n",
    "            start=times_start,\n",
    "            end=times_end,\n",
    "            freq='4h'\n",
    "        )\n",
    "        docs = doctors\n",
    "        \n",
    "        dat = pd.DataFrame(columns=times) #  график по часам, без врачей\n",
    "        \n",
    "        for i in range(doctors):\n",
    "            # 84 интервала отпуск в 2 недели\n",
    "            # вид смены 5/2\n",
    "            # вид смены 2/2\n",
    "            # вид смены\n",
    "            dat.loc[i+1] = np.zeros(len(times))\n",
    "            \n",
    "        self.availability_interval = dat\n",
    "        \n",
    "    def gen_normatives(self) -> None:\n",
    "        \"\"\"\n",
    "        Нормативы из файлов\n",
    "        \"\"\"\n",
    "        df = pd.DataFrame(columns=[\"min\", \"max\"])\n",
    "        types = [\n",
    "            'КТ', 'КТ с КУ', 'КТ с КУ 2',\n",
    "            'МРТ', 'МРТ с КУ', 'МРТ с КУ 2',\n",
    "            'РГ', 'ФЛГ', 'ММГ', 'Денситометр'\n",
    "        ]\n",
    "        mins = [\n",
    "            15.6, 9., 6., 12., 8., 5., 49.2, 181., 49.2, 84. \n",
    "        ]\n",
    "        maxs = [\n",
    "            39., 24., 17., 30., 23., 15., 123., 451., 123., 210.\n",
    "        ]\n",
    "        for t, mis, mas in zip(types, mins, maxs):\n",
    "            df.loc[t] = [mis, mas]\n",
    "            \n",
    "        self.normatives = df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {},
   "outputs": [],
   "source": [
    "ex = DataDoctors(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['__class__',\n",
       " '__delattr__',\n",
       " '__dict__',\n",
       " '__dir__',\n",
       " '__doc__',\n",
       " '__eq__',\n",
       " '__format__',\n",
       " '__ge__',\n",
       " '__getattribute__',\n",
       " '__gt__',\n",
       " '__hash__',\n",
       " '__init__',\n",
       " '__init_subclass__',\n",
       " '__le__',\n",
       " '__lt__',\n",
       " '__module__',\n",
       " '__ne__',\n",
       " '__new__',\n",
       " '__reduce__',\n",
       " '__reduce_ex__',\n",
       " '__repr__',\n",
       " '__setattr__',\n",
       " '__sizeof__',\n",
       " '__str__',\n",
       " '__subclasshook__',\n",
       " '__weakref__',\n",
       " 'gen_availability_interval',\n",
       " 'gen_docs',\n",
       " 'gen_employee_rate',\n",
       " 'gen_holiday',\n",
       " 'gen_hours_worked',\n",
       " 'gen_individual_graph',\n",
       " 'gen_night_duty',\n",
       " 'gen_normatives',\n",
       " 'gen_rest',\n",
       " 'gen_solution_tale',\n",
       " 'gen_spec']"
      ]
     },
     "execution_count": 198,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(DataDoctors)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Основа</th>\n",
       "      <th>РГ</th>\n",
       "      <th>ММГ</th>\n",
       "      <th>МРТ</th>\n",
       "      <th>КТ</th>\n",
       "      <th>ФЛГ</th>\n",
       "      <th>Денс</th>\n",
       "      <th>Ставка</th>\n",
       "      <th>Дежурство</th>\n",
       "      <th>График</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.25</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Основа  РГ  ММГ  МРТ  КТ  ФЛГ  Денс  Ставка  Дежурство  График\n",
       "0       4   0    1    0   1    0     1    0.25          0       2\n",
       "1       1   1    1    0   1    1     1    0.50          0       3"
      ]
     },
     "execution_count": 199,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ex.gen_docs(2)\n",
    "ex.docs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Отработка</th>\n",
       "      <th>Отдых</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>32</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Отработка  Отдых\n",
       "0         32      0\n",
       "1         16      0"
      ]
     },
     "execution_count": 200,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ex.gen_solution_tale(2)\n",
    "ex.solution_tale"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       True\n",
       "1       True\n",
       "2       True\n",
       "3       True\n",
       "4       True\n",
       "       ...  \n",
       "182    False\n",
       "183    False\n",
       "184    False\n",
       "185    False\n",
       "186    False\n",
       "Length: 187, dtype: bool"
      ]
     },
     "execution_count": 201,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ex.gen_holiday('2022-01-01', '2022-02-01')\n",
    "ex.holiday_date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>КТ</th>\n",
       "      <td>15.6</td>\n",
       "      <td>39.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>КТ с КУ</th>\n",
       "      <td>9.0</td>\n",
       "      <td>24.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>КТ с КУ 2</th>\n",
       "      <td>6.0</td>\n",
       "      <td>17.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>МРТ</th>\n",
       "      <td>12.0</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>МРТ с КУ</th>\n",
       "      <td>8.0</td>\n",
       "      <td>23.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>МРТ с КУ 2</th>\n",
       "      <td>5.0</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>РГ</th>\n",
       "      <td>49.2</td>\n",
       "      <td>123.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ФЛГ</th>\n",
       "      <td>181.0</td>\n",
       "      <td>451.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ММГ</th>\n",
       "      <td>49.2</td>\n",
       "      <td>123.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Денситометр</th>\n",
       "      <td>84.0</td>\n",
       "      <td>210.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               min    max\n",
       "КТ            15.6   39.0\n",
       "КТ с КУ        9.0   24.0\n",
       "КТ с КУ 2      6.0   17.0\n",
       "МРТ           12.0   30.0\n",
       "МРТ с КУ       8.0   23.0\n",
       "МРТ с КУ 2     5.0   15.0\n",
       "РГ            49.2  123.0\n",
       "ФЛГ          181.0  451.0\n",
       "ММГ           49.2  123.0\n",
       "Денситометр   84.0  210.0"
      ]
     },
     "execution_count": 202,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ex.gen_normatives()\n",
    "ex.normatives"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 203,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2022-01-01 00:00:00</th>\n",
       "      <th>2022-01-01 04:00:00</th>\n",
       "      <th>2022-01-01 08:00:00</th>\n",
       "      <th>2022-01-01 12:00:00</th>\n",
       "      <th>2022-01-01 16:00:00</th>\n",
       "      <th>2022-01-01 20:00:00</th>\n",
       "      <th>2022-01-02 00:00:00</th>\n",
       "      <th>2022-01-02 04:00:00</th>\n",
       "      <th>2022-01-02 08:00:00</th>\n",
       "      <th>2022-01-02 12:00:00</th>\n",
       "      <th>...</th>\n",
       "      <th>2022-01-30 12:00:00</th>\n",
       "      <th>2022-01-30 16:00:00</th>\n",
       "      <th>2022-01-30 20:00:00</th>\n",
       "      <th>2022-01-31 00:00:00</th>\n",
       "      <th>2022-01-31 04:00:00</th>\n",
       "      <th>2022-01-31 08:00:00</th>\n",
       "      <th>2022-01-31 12:00:00</th>\n",
       "      <th>2022-01-31 16:00:00</th>\n",
       "      <th>2022-01-31 20:00:00</th>\n",
       "      <th>2022-02-01 00:00:00</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 187 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   2022-01-01 00:00:00  2022-01-01 04:00:00  2022-01-01 08:00:00  \\\n",
       "1                  0.0                  0.0                  0.0   \n",
       "2                  0.0                  0.0                  0.0   \n",
       "3                  0.0                  0.0                  0.0   \n",
       "4                  0.0                  0.0                  0.0   \n",
       "5                  0.0                  0.0                  0.0   \n",
       "\n",
       "   2022-01-01 12:00:00  2022-01-01 16:00:00  2022-01-01 20:00:00  \\\n",
       "1                  0.0                  0.0                  0.0   \n",
       "2                  0.0                  0.0                  0.0   \n",
       "3                  0.0                  0.0                  0.0   \n",
       "4                  0.0                  0.0                  0.0   \n",
       "5                  0.0                  0.0                  0.0   \n",
       "\n",
       "   2022-01-02 00:00:00  2022-01-02 04:00:00  2022-01-02 08:00:00  \\\n",
       "1                  0.0                  0.0                  0.0   \n",
       "2                  0.0                  0.0                  0.0   \n",
       "3                  0.0                  0.0                  0.0   \n",
       "4                  0.0                  0.0                  0.0   \n",
       "5                  0.0                  0.0                  0.0   \n",
       "\n",
       "   2022-01-02 12:00:00  ...  2022-01-30 12:00:00  2022-01-30 16:00:00  \\\n",
       "1                  0.0  ...                  0.0                  0.0   \n",
       "2                  0.0  ...                  0.0                  0.0   \n",
       "3                  0.0  ...                  0.0                  0.0   \n",
       "4                  0.0  ...                  0.0                  0.0   \n",
       "5                  0.0  ...                  0.0                  0.0   \n",
       "\n",
       "   2022-01-30 20:00:00  2022-01-31 00:00:00  2022-01-31 04:00:00  \\\n",
       "1                  0.0                  0.0                  0.0   \n",
       "2                  0.0                  0.0                  0.0   \n",
       "3                  0.0                  0.0                  0.0   \n",
       "4                  0.0                  0.0                  0.0   \n",
       "5                  0.0                  0.0                  0.0   \n",
       "\n",
       "   2022-01-31 08:00:00  2022-01-31 12:00:00  2022-01-31 16:00:00  \\\n",
       "1                  0.0                  0.0                  0.0   \n",
       "2                  0.0                  0.0                  0.0   \n",
       "3                  0.0                  0.0                  0.0   \n",
       "4                  0.0                  0.0                  0.0   \n",
       "5                  0.0                  0.0                  0.0   \n",
       "\n",
       "   2022-01-31 20:00:00  2022-02-01 00:00:00  \n",
       "1                  0.0                  0.0  \n",
       "2                  0.0                  0.0  \n",
       "3                  0.0                  0.0  \n",
       "4                  0.0                  0.0  \n",
       "5                  0.0                  0.0  \n",
       "\n",
       "[5 rows x 187 columns]"
      ]
     },
     "execution_count": 203,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ex.gen_availability_interval('2022-01-01', '2022-02-01', 5)\n",
    "ex.availability_interval"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Реальные данные"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "metadata": {},
   "outputs": [],
   "source": [
    "# поставить удобные даты\n",
    "start_prediction = '2024-01-02'\n",
    "end_prediction   = '2024-03-01'\n",
    "docs_cnt = 368\n",
    "\n",
    "realdata = DataDoctors(docs_cnt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 205,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>КТ</th>\n",
       "      <td>15.6</td>\n",
       "      <td>39.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>КТ с КУ</th>\n",
       "      <td>9.0</td>\n",
       "      <td>24.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>КТ с КУ 2</th>\n",
       "      <td>6.0</td>\n",
       "      <td>17.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>МРТ</th>\n",
       "      <td>12.0</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>МРТ с КУ</th>\n",
       "      <td>8.0</td>\n",
       "      <td>23.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>МРТ с КУ 2</th>\n",
       "      <td>5.0</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>РГ</th>\n",
       "      <td>49.2</td>\n",
       "      <td>123.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ФЛГ</th>\n",
       "      <td>181.0</td>\n",
       "      <td>451.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ММГ</th>\n",
       "      <td>49.2</td>\n",
       "      <td>123.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Денситометр</th>\n",
       "      <td>84.0</td>\n",
       "      <td>210.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               min    max\n",
       "КТ            15.6   39.0\n",
       "КТ с КУ        9.0   24.0\n",
       "КТ с КУ 2      6.0   17.0\n",
       "МРТ           12.0   30.0\n",
       "МРТ с КУ       8.0   23.0\n",
       "МРТ с КУ 2     5.0   15.0\n",
       "РГ            49.2  123.0\n",
       "ФЛГ          181.0  451.0\n",
       "ММГ           49.2  123.0\n",
       "Денситометр   84.0  210.0"
      ]
     },
     "execution_count": 205,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# составлены с оглядкой на файлы\n",
    "realdata.gen_normatives()\n",
    "realdata.normatives.to_excel('normatives.xlsx', index=False) \n",
    "\n",
    "realdata.normatives"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 206,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       True\n",
       "1       True\n",
       "2       True\n",
       "3       True\n",
       "4       True\n",
       "       ...  \n",
       "350    False\n",
       "351    False\n",
       "352    False\n",
       "353    False\n",
       "354    False\n",
       "Length: 355, dtype: bool"
      ]
     },
     "execution_count": 206,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# взято из тк рф, нужно указать требуемые даты\n",
    "# дискретизация по 4 часа\n",
    "realdata.gen_holiday(start_prediction, end_prediction)\n",
    "realdata.holiday_date.astype(int).to_excel('holidays.xlsx', index=False)\n",
    "realdata.holiday_date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 207,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Отработка</th>\n",
       "      <th>Отдых</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>16</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>32</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>363</th>\n",
       "      <td>32</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>364</th>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>366</th>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367</th>\n",
       "      <td>24</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>368 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Отработка  Отдых\n",
       "0           16      1\n",
       "1            8      0\n",
       "2           32      1\n",
       "3           32      0\n",
       "4           24      0\n",
       "..         ...    ...\n",
       "363         32      0\n",
       "364         32      1\n",
       "365         16      0\n",
       "366          8      0\n",
       "367         24      1\n",
       "\n",
       "[368 rows x 2 columns]"
      ]
     },
     "execution_count": 207,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# это генерируется случайно, не нужно оглядываться на данные (только количество врачей)\n",
    "realdata.gen_solution_tale(docs_cnt)\n",
    "realdata.solution_tale.to_excel('solution_tale.xlsx', index=False) \n",
    "realdata.solution_tale"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 208,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2024-01-02 00:00:00</th>\n",
       "      <th>2024-01-02 04:00:00</th>\n",
       "      <th>2024-01-02 08:00:00</th>\n",
       "      <th>2024-01-02 12:00:00</th>\n",
       "      <th>2024-01-02 16:00:00</th>\n",
       "      <th>2024-01-02 20:00:00</th>\n",
       "      <th>2024-01-03 00:00:00</th>\n",
       "      <th>2024-01-03 04:00:00</th>\n",
       "      <th>2024-01-03 08:00:00</th>\n",
       "      <th>2024-01-03 12:00:00</th>\n",
       "      <th>...</th>\n",
       "      <th>2024-02-28 12:00:00</th>\n",
       "      <th>2024-02-28 16:00:00</th>\n",
       "      <th>2024-02-28 20:00:00</th>\n",
       "      <th>2024-02-29 00:00:00</th>\n",
       "      <th>2024-02-29 04:00:00</th>\n",
       "      <th>2024-02-29 08:00:00</th>\n",
       "      <th>2024-02-29 12:00:00</th>\n",
       "      <th>2024-02-29 16:00:00</th>\n",
       "      <th>2024-02-29 20:00:00</th>\n",
       "      <th>2024-03-01 00:00:00</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>364</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>366</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>368</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>368 rows × 355 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     2024-01-02 00:00:00  2024-01-02 04:00:00  2024-01-02 08:00:00  \\\n",
       "1                    0.0                  0.0                  0.0   \n",
       "2                    0.0                  0.0                  0.0   \n",
       "3                    0.0                  0.0                  0.0   \n",
       "4                    0.0                  0.0                  0.0   \n",
       "5                    0.0                  0.0                  0.0   \n",
       "..                   ...                  ...                  ...   \n",
       "364                  0.0                  0.0                  0.0   \n",
       "365                  0.0                  0.0                  0.0   \n",
       "366                  0.0                  0.0                  0.0   \n",
       "367                  0.0                  0.0                  0.0   \n",
       "368                  0.0                  0.0                  0.0   \n",
       "\n",
       "     2024-01-02 12:00:00  2024-01-02 16:00:00  2024-01-02 20:00:00  \\\n",
       "1                    0.0                  0.0                  0.0   \n",
       "2                    0.0                  0.0                  0.0   \n",
       "3                    0.0                  0.0                  0.0   \n",
       "4                    0.0                  0.0                  0.0   \n",
       "5                    0.0                  0.0                  0.0   \n",
       "..                   ...                  ...                  ...   \n",
       "364                  0.0                  0.0                  0.0   \n",
       "365                  0.0                  0.0                  0.0   \n",
       "366                  0.0                  0.0                  0.0   \n",
       "367                  0.0                  0.0                  0.0   \n",
       "368                  0.0                  0.0                  0.0   \n",
       "\n",
       "     2024-01-03 00:00:00  2024-01-03 04:00:00  2024-01-03 08:00:00  \\\n",
       "1                    0.0                  0.0                  0.0   \n",
       "2                    0.0                  0.0                  0.0   \n",
       "3                    0.0                  0.0                  0.0   \n",
       "4                    0.0                  0.0                  0.0   \n",
       "5                    0.0                  0.0                  0.0   \n",
       "..                   ...                  ...                  ...   \n",
       "364                  0.0                  0.0                  0.0   \n",
       "365                  0.0                  0.0                  0.0   \n",
       "366                  0.0                  0.0                  0.0   \n",
       "367                  0.0                  0.0                  0.0   \n",
       "368                  0.0                  0.0                  0.0   \n",
       "\n",
       "     2024-01-03 12:00:00  ...  2024-02-28 12:00:00  2024-02-28 16:00:00  \\\n",
       "1                    0.0  ...                  0.0                  0.0   \n",
       "2                    0.0  ...                  0.0                  0.0   \n",
       "3                    0.0  ...                  0.0                  0.0   \n",
       "4                    0.0  ...                  0.0                  0.0   \n",
       "5                    0.0  ...                  0.0                  0.0   \n",
       "..                   ...  ...                  ...                  ...   \n",
       "364                  0.0  ...                  0.0                  0.0   \n",
       "365                  0.0  ...                  0.0                  0.0   \n",
       "366                  0.0  ...                  0.0                  0.0   \n",
       "367                  0.0  ...                  0.0                  0.0   \n",
       "368                  0.0  ...                  0.0                  0.0   \n",
       "\n",
       "     2024-02-28 20:00:00  2024-02-29 00:00:00  2024-02-29 04:00:00  \\\n",
       "1                    0.0                  0.0                  0.0   \n",
       "2                    0.0                  0.0                  0.0   \n",
       "3                    0.0                  0.0                  0.0   \n",
       "4                    0.0                  0.0                  0.0   \n",
       "5                    0.0                  0.0                  0.0   \n",
       "..                   ...                  ...                  ...   \n",
       "364                  0.0                  0.0                  0.0   \n",
       "365                  0.0                  0.0                  0.0   \n",
       "366                  0.0                  0.0                  0.0   \n",
       "367                  0.0                  0.0                  0.0   \n",
       "368                  0.0                  0.0                  0.0   \n",
       "\n",
       "     2024-02-29 08:00:00  2024-02-29 12:00:00  2024-02-29 16:00:00  \\\n",
       "1                    0.0                  0.0                  0.0   \n",
       "2                    0.0                  0.0                  0.0   \n",
       "3                    0.0                  0.0                  0.0   \n",
       "4                    0.0                  0.0                  0.0   \n",
       "5                    0.0                  0.0                  0.0   \n",
       "..                   ...                  ...                  ...   \n",
       "364                  0.0                  0.0                  0.0   \n",
       "365                  0.0                  0.0                  0.0   \n",
       "366                  0.0                  0.0                  0.0   \n",
       "367                  0.0                  0.0                  0.0   \n",
       "368                  0.0                  0.0                  0.0   \n",
       "\n",
       "     2024-02-29 20:00:00  2024-03-01 00:00:00  \n",
       "1                    0.0                  0.0  \n",
       "2                    0.0                  0.0  \n",
       "3                    0.0                  0.0  \n",
       "4                    0.0                  0.0  \n",
       "5                    0.0                  0.0  \n",
       "..                   ...                  ...  \n",
       "364                  0.0                  0.0  \n",
       "365                  0.0                  0.0  \n",
       "366                  0.0                  0.0  \n",
       "367                  0.0                  0.0  \n",
       "368                  0.0                  0.0  \n",
       "\n",
       "[368 rows x 355 columns]"
      ]
     },
     "execution_count": 208,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# это генерируется случайно, не нужно оглядываться на данные (только количество врачей и даты)\n",
    "realdata.gen_availability_interval(start_prediction, end_prediction, docs_cnt)\n",
    "realdata.availability_interval.to_excel('availability_interval.xlsx', index=False)\n",
    "realdata.availability_interval"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "metadata": {},
   "outputs": [],
   "source": [
    "# дальше инфа берется из файлов"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 210,
   "metadata": {},
   "outputs": [],
   "source": [
    "doctor_data = pd.read_excel('Data/Пример табеля с количеством врачей в разрезе модальностей и доп модальностей.xlsx')\n",
    "doctor_data = doctor_data[doctor_data['Фамилия,\\nИмя,\\nОтчество'].notna()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 211,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Фамилия,\\nИмя,\\nОтчество</th>\n",
       "      <th>Модальность</th>\n",
       "      <th>Дополнительные модальности</th>\n",
       "      <th>Ставка</th>\n",
       "      <th>Таб.\\n№</th>\n",
       "      <th>Unnamed: 5</th>\n",
       "      <th>Числа месяца</th>\n",
       "      <th>Unnamed: 7</th>\n",
       "      <th>Unnamed: 8</th>\n",
       "      <th>Unnamed: 9</th>\n",
       "      <th>...</th>\n",
       "      <th>Unnamed: 33</th>\n",
       "      <th>Unnamed: 34</th>\n",
       "      <th>Unnamed: 35</th>\n",
       "      <th>Unnamed: 36</th>\n",
       "      <th>Unnamed: 37</th>\n",
       "      <th>Unnamed: 38</th>\n",
       "      <th>Норма\\nчасов\\nпо\\nграфику</th>\n",
       "      <th>Норма\\nчасов за\\nполный\\nмесяц</th>\n",
       "      <th>Дата</th>\n",
       "      <th>Подпись</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Врач1</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ,ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>08:00</td>\n",
       "      <td>...</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>155.0</td>\n",
       "      <td>155.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Врач2</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ,ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>0.75</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Врач3</td>\n",
       "      <td>ММГ</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Врач4</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ,ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Врач5</td>\n",
       "      <td>МРТ</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1453</th>\n",
       "      <td>Врач364</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ</td>\n",
       "      <td>0.75</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1457</th>\n",
       "      <td>Врач365</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ, ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1461</th>\n",
       "      <td>Врач366</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ, ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1465</th>\n",
       "      <td>Врач367</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ, ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>0.50</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1469</th>\n",
       "      <td>Врач368</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ, ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>368 rows × 43 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Фамилия,\\nИмя,\\nОтчество Модальность  Дополнительные модальности  Ставка  \\\n",
       "1                       Врач1          РГ   КТ,ММГ,ФЛГ, Денситометрия    1.00   \n",
       "5                       Врач2          РГ   КТ,ММГ,ФЛГ, Денситометрия    0.75   \n",
       "9                       Врач3         ММГ                         NaN    1.00   \n",
       "13                      Врач4          РГ   КТ,ММГ,ФЛГ, Денситометрия    1.00   \n",
       "17                      Врач5         МРТ                         NaN    1.00   \n",
       "...                       ...         ...                         ...     ...   \n",
       "1453                  Врач364          РГ                          КТ    0.75   \n",
       "1457                  Врач365          РГ  КТ, ММГ,ФЛГ, Денситометрия    1.00   \n",
       "1461                  Врач366          РГ  КТ, ММГ,ФЛГ, Денситометрия    1.00   \n",
       "1465                  Врач367          РГ  КТ, ММГ,ФЛГ, Денситометрия    0.50   \n",
       "1469                  Врач368          РГ  КТ, ММГ,ФЛГ, Денситометрия    1.00   \n",
       "\n",
       "      Таб.\\n№ Unnamed: 5 Числа месяца  Unnamed: 7  Unnamed: 8 Unnamed: 9  ...  \\\n",
       "1         NaN          с        08:00         NaN         NaN      08:00  ...   \n",
       "5         NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "9         NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "13        NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "17        NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "...       ...        ...          ...         ...         ...        ...  ...   \n",
       "1453      NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "1457      NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "1461      NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "1465      NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "1469      NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "\n",
       "      Unnamed: 33 Unnamed: 34 Unnamed: 35  Unnamed: 36  Unnamed: 37  \\\n",
       "1           08:00         NaN       08:00          NaN          NaN   \n",
       "5             NaN         NaN         NaN          NaN          NaN   \n",
       "9             NaN         NaN         NaN          NaN          NaN   \n",
       "13            NaN         NaN         NaN          NaN          NaN   \n",
       "17            NaN         NaN         NaN          NaN          NaN   \n",
       "...           ...         ...         ...          ...          ...   \n",
       "1453          NaN         NaN         NaN          NaN          NaN   \n",
       "1457          NaN         NaN         NaN          NaN          NaN   \n",
       "1461          NaN         NaN         NaN          NaN          NaN   \n",
       "1465          NaN         NaN         NaN          NaN          NaN   \n",
       "1469          NaN         NaN         NaN          NaN          NaN   \n",
       "\n",
       "      Unnamed: 38 Норма\\nчасов\\nпо\\nграфику  Норма\\nчасов за\\nполный\\nмесяц  \\\n",
       "1             NaN                     155.0                           155.0   \n",
       "5             NaN                       NaN                             NaN   \n",
       "9             NaN                       NaN                             NaN   \n",
       "13            NaN                       NaN                             NaN   \n",
       "17            NaN                       NaN                             NaN   \n",
       "...           ...                       ...                             ...   \n",
       "1453          NaN                       NaN                             NaN   \n",
       "1457          NaN                       NaN                             NaN   \n",
       "1461          NaN                       NaN                             NaN   \n",
       "1465          NaN                       NaN                             NaN   \n",
       "1469          NaN                       NaN                             NaN   \n",
       "\n",
       "     Дата  Подпись  \n",
       "1     NaN      NaN  \n",
       "5     NaN      NaN  \n",
       "9     NaN      NaN  \n",
       "13    NaN      NaN  \n",
       "17    NaN      NaN  \n",
       "...   ...      ...  \n",
       "1453  NaN      NaN  \n",
       "1457  NaN      NaN  \n",
       "1461  NaN      NaN  \n",
       "1465  NaN      NaN  \n",
       "1469  NaN      NaN  \n",
       "\n",
       "[368 rows x 43 columns]"
      ]
     },
     "execution_count": 211,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "doctor_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 212,
   "metadata": {},
   "outputs": [],
   "source": [
    "mods = ['РГ', 'ММГ', 'МРТ', 'КТ', 'ФЛГ', 'Денситометрия']\n",
    "mod_dict = {m:n+1 for n, m in enumerate(mods)}\n",
    "docs_mod = doctor_data['Модальность'].map(mod_dict).to_numpy()\n",
    "for m in mods:\n",
    "    check_element = lambda x: m in x\n",
    "    #  заполняем как просили \n",
    "    dm = (doctor_data['Дополнительные модальности']\\\n",
    "    .fillna('').apply(check_element)|doctor_data['Модальность'].apply(check_element))\\\n",
    "    .to_numpy().astype(int)\n",
    "    docs_mod = np.r_['1,2,0', docs_mod, dm]\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(368, 7)"
      ]
     },
     "execution_count": 213,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "docs_mod.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 214,
   "metadata": {},
   "outputs": [],
   "source": [
    "realdata.gen_docs(\n",
    "    docs_cnt,\n",
    "    doctor_data['Ставка'].to_numpy(),\n",
    "    [i.tolist() for i in docs_mod]\n",
    ")\n",
    "realdata.docs.to_excel('docs_info.xlsx', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 215,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Основа</th>\n",
       "      <th>РГ</th>\n",
       "      <th>ММГ</th>\n",
       "      <th>МРТ</th>\n",
       "      <th>КТ</th>\n",
       "      <th>ФЛГ</th>\n",
       "      <th>Денс</th>\n",
       "      <th>Ставка</th>\n",
       "      <th>Дежурство</th>\n",
       "      <th>График</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.75</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>363</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.75</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>364</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>366</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.50</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>368 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Основа  РГ  ММГ  МРТ  КТ  ФЛГ  Денс  Ставка  Дежурство  График\n",
       "0         1   1    1    0   1    1     1    1.00          0       3\n",
       "1         1   1    1    0   1    1     1    0.75          0       2\n",
       "2         2   0    1    0   0    0     0    1.00          0       2\n",
       "3         1   1    1    0   1    1     1    1.00          0       2\n",
       "4         3   0    0    1   0    0     0    1.00          0       3\n",
       "..      ...  ..  ...  ...  ..  ...   ...     ...        ...     ...\n",
       "363       1   1    0    0   1    0     0    0.75          0       2\n",
       "364       1   1    1    0   1    1     1    1.00          0       2\n",
       "365       1   1    1    0   1    1     1    1.00          0       2\n",
       "366       1   1    1    0   1    1     1    0.50          1       6\n",
       "367       1   1    1    0   1    1     1    1.00          0       2\n",
       "\n",
       "[368 rows x 10 columns]"
      ]
     },
     "execution_count": 215,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "realdata.docs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Строим табель"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Фамилия,\\nИмя,\\nОтчество</th>\n",
       "      <th>Модальность</th>\n",
       "      <th>Дополнительные модальности</th>\n",
       "      <th>Ставка</th>\n",
       "      <th>Таб.\\n№</th>\n",
       "      <th>Unnamed: 5</th>\n",
       "      <th>Числа месяца</th>\n",
       "      <th>Unnamed: 7</th>\n",
       "      <th>Unnamed: 8</th>\n",
       "      <th>Unnamed: 9</th>\n",
       "      <th>...</th>\n",
       "      <th>Unnamed: 33</th>\n",
       "      <th>Unnamed: 34</th>\n",
       "      <th>Unnamed: 35</th>\n",
       "      <th>Unnamed: 36</th>\n",
       "      <th>Unnamed: 37</th>\n",
       "      <th>Unnamed: 38</th>\n",
       "      <th>Норма\\nчасов\\nпо\\nграфику</th>\n",
       "      <th>Норма\\nчасов за\\nполный\\nмесяц</th>\n",
       "      <th>Дата</th>\n",
       "      <th>Подпись</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>27</td>\n",
       "      <td>28.0</td>\n",
       "      <td>29</td>\n",
       "      <td>30.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>Итого за 2 пол. месяца</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Врач1</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ,ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>08:00</td>\n",
       "      <td>...</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>155.0</td>\n",
       "      <td>155.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>до</td>\n",
       "      <td>20:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20:30</td>\n",
       "      <td>...</td>\n",
       "      <td>20:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>перерыв</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>30</td>\n",
       "      <td>...</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1468</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1469</th>\n",
       "      <td>Врач368</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ, ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1470</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>до</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1471</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>перерыв</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1472</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1473 rows × 43 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Фамилия,\\nИмя,\\nОтчество Модальность  Дополнительные модальности  Ставка  \\\n",
       "0                         NaN         NaN                         NaN     NaN   \n",
       "1                       Врач1          РГ   КТ,ММГ,ФЛГ, Денситометрия     1.0   \n",
       "2                         NaN         NaN                         NaN     NaN   \n",
       "3                         NaN         NaN                         NaN     NaN   \n",
       "4                         NaN         NaN                         NaN     NaN   \n",
       "...                       ...         ...                         ...     ...   \n",
       "1468                      NaN         NaN                         NaN     NaN   \n",
       "1469                  Врач368          РГ  КТ, ММГ,ФЛГ, Денситометрия     1.0   \n",
       "1470                      NaN         NaN                         NaN     NaN   \n",
       "1471                      NaN         NaN                         NaN     NaN   \n",
       "1472                      NaN         NaN                         NaN     NaN   \n",
       "\n",
       "      Таб.\\n№ Unnamed: 5 Числа месяца  Unnamed: 7  Unnamed: 8 Unnamed: 9  ...  \\\n",
       "0         NaN        NaN            1         2.0         3.0          4  ...   \n",
       "1         NaN          с        08:00         NaN         NaN      08:00  ...   \n",
       "2         NaN         до        20:30         NaN         NaN      20:30  ...   \n",
       "3         NaN    перерыв           30         NaN         NaN         30  ...   \n",
       "4         NaN     отраб.           12         NaN         NaN         12  ...   \n",
       "...       ...        ...          ...         ...         ...        ...  ...   \n",
       "1468      NaN     отраб.          NaN         NaN         NaN        NaN  ...   \n",
       "1469      NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "1470      NaN         до          NaN         NaN         NaN        NaN  ...   \n",
       "1471      NaN    перерыв          NaN         NaN         NaN        NaN  ...   \n",
       "1472      NaN     отраб.          NaN         NaN         NaN        NaN  ...   \n",
       "\n",
       "      Unnamed: 33 Unnamed: 34 Unnamed: 35  Unnamed: 36  Unnamed: 37  \\\n",
       "0              27        28.0          29         30.0         31.0   \n",
       "1           08:00         NaN       08:00          NaN          NaN   \n",
       "2           20:30         NaN       20:30          NaN          NaN   \n",
       "3              30         NaN          30          NaN          NaN   \n",
       "4              12         NaN          12          NaN          NaN   \n",
       "...           ...         ...         ...          ...          ...   \n",
       "1468          NaN         NaN         NaN          NaN          NaN   \n",
       "1469          NaN         NaN         NaN          NaN          NaN   \n",
       "1470          NaN         NaN         NaN          NaN          NaN   \n",
       "1471          NaN         NaN         NaN          NaN          NaN   \n",
       "1472          NaN         NaN         NaN          NaN          NaN   \n",
       "\n",
       "                 Unnamed: 38 Норма\\nчасов\\nпо\\nграфику  \\\n",
       "0     Итого за 2 пол. месяца                       NaN   \n",
       "1                        NaN                     155.0   \n",
       "2                        NaN                       NaN   \n",
       "3                        NaN                       NaN   \n",
       "4                       72.0                       NaN   \n",
       "...                      ...                       ...   \n",
       "1468                     NaN                       NaN   \n",
       "1469                     NaN                       NaN   \n",
       "1470                     NaN                       NaN   \n",
       "1471                     NaN                       NaN   \n",
       "1472                     NaN                       NaN   \n",
       "\n",
       "      Норма\\nчасов за\\nполный\\nмесяц Дата  Подпись  \n",
       "0                                NaN  NaN      NaN  \n",
       "1                              155.0  NaN      NaN  \n",
       "2                                NaN  NaN      NaN  \n",
       "3                                NaN  NaN      NaN  \n",
       "4                                NaN  NaN      NaN  \n",
       "...                              ...  ...      ...  \n",
       "1468                             NaN  NaN      NaN  \n",
       "1469                             NaN  NaN      NaN  \n",
       "1470                             NaN  NaN      NaN  \n",
       "1471                             NaN  NaN      NaN  \n",
       "1472                             NaN  NaN      NaN  \n",
       "\n",
       "[1473 rows x 43 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "doctor_data = pd.read_excel('Data/Пример табеля с количеством врачей в разрезе модальностей и доп модальностей.xlsx')\n",
    "doctor_data\n",
    "# это шаблон, который должна выдавать система, после составления расписания\n",
    "# не на что тут смотреть"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>1_0</th>\n",
       "      <th>1_4</th>\n",
       "      <th>1_8</th>\n",
       "      <th>1_12</th>\n",
       "      <th>1_16</th>\n",
       "      <th>1_20</th>\n",
       "      <th>2_0</th>\n",
       "      <th>2_4</th>\n",
       "      <th>2_8</th>\n",
       "      <th>2_12</th>\n",
       "      <th>...</th>\n",
       "      <th>30_8</th>\n",
       "      <th>30_12</th>\n",
       "      <th>30_16</th>\n",
       "      <th>30_20</th>\n",
       "      <th>31_0</th>\n",
       "      <th>31_4</th>\n",
       "      <th>31_8</th>\n",
       "      <th>31_12</th>\n",
       "      <th>31_16</th>\n",
       "      <th>31_20</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>363</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>364</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>366</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>368 rows × 186 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     1_0  1_4  1_8  1_12  1_16  1_20  2_0  2_4  2_8  2_12  ...  30_8  30_12  \\\n",
       "0      0    0    1     1     1     0    0    0    0     0  ...     0      0   \n",
       "1      0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "2      0    0    1     1     0     0    0    0    1     1  ...     1      1   \n",
       "3      0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "4      0    0    1     1     1     0    0    0    0     0  ...     0      0   \n",
       "..   ...  ...  ...   ...   ...   ...  ...  ...  ...   ...  ...   ...    ...   \n",
       "363    0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "364    0    0    1     1     0     0    0    0    1     1  ...     1      1   \n",
       "365    0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "366    0    0    0     0     0     1    1    1    1     1  ...     0      0   \n",
       "367    0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "\n",
       "     30_16  30_20  31_0  31_4  31_8  31_12  31_16  31_20  \n",
       "0        0      0     0     0     1      1      1      0  \n",
       "1        1      1     0     0     0      0      1      1  \n",
       "2        0      0     0     0     1      1      0      0  \n",
       "3        1      1     0     0     0      0      1      1  \n",
       "4        0      0     0     0     1      1      1      0  \n",
       "..     ...    ...   ...   ...   ...    ...    ...    ...  \n",
       "363      1      1     0     0     0      0      1      1  \n",
       "364      0      0     0     0     1      1      0      0  \n",
       "365      1      1     0     0     0      0      1      1  \n",
       "366      0      0     0     0     0      0      0      1  \n",
       "367      1      1     0     0     0      0      1      1  \n",
       "\n",
       "[368 rows x 186 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>1_0</th>\n",
       "      <th>1_4</th>\n",
       "      <th>1_8</th>\n",
       "      <th>1_12</th>\n",
       "      <th>1_16</th>\n",
       "      <th>1_20</th>\n",
       "      <th>2_0</th>\n",
       "      <th>2_4</th>\n",
       "      <th>2_8</th>\n",
       "      <th>2_12</th>\n",
       "      <th>...</th>\n",
       "      <th>30_8</th>\n",
       "      <th>30_12</th>\n",
       "      <th>30_16</th>\n",
       "      <th>30_20</th>\n",
       "      <th>31_0</th>\n",
       "      <th>31_4</th>\n",
       "      <th>31_8</th>\n",
       "      <th>31_12</th>\n",
       "      <th>31_16</th>\n",
       "      <th>31_20</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>134</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>135</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>137</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>138</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>139 rows × 186 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     1_0  1_4  1_8  1_12  1_16  1_20  2_0  2_4  2_8  2_12  ...  30_8  30_12  \\\n",
       "0      0    0    1     1     1     0    0    0    0     0  ...     0      0   \n",
       "1      0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "2      0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "3      0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "4      0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "..   ...  ...  ...   ...   ...   ...  ...  ...  ...   ...  ...   ...    ...   \n",
       "134    1    1    0     0     0     0    1    1    0     0  ...     0      0   \n",
       "135    0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "136    0    0    0     0     1     1    0    0    0     0  ...     0      0   \n",
       "137    0    0    1     1     0     0    0    0    1     1  ...     1      1   \n",
       "138    0    0    0     0     0     1    1    1    1     1  ...     0      0   \n",
       "\n",
       "     30_16  30_20  31_0  31_4  31_8  31_12  31_16  31_20  \n",
       "0        0      0     0     0     1      1      1      0  \n",
       "1        1      1     0     0     0      0      1      1  \n",
       "2        1      1     0     0     0      0      1      1  \n",
       "3        1      1     0     0     0      0      1      1  \n",
       "4        1      1     0     0     0      0      1      1  \n",
       "..     ...    ...   ...   ...   ...    ...    ...    ...  \n",
       "134      0      0     1     1     0      0      0      0  \n",
       "135      1      1     0     0     0      0      1      1  \n",
       "136      1      1     0     0     0      0      1      1  \n",
       "137      0      0     0     0     1      1      0      0  \n",
       "138      0      0     0     0     0      0      0      1  \n",
       "\n",
       "[139 rows x 186 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solution = pd.read_excel('final_schedule_v3.xlsx')\n",
    "solution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Фамилия,\\nИмя,\\nОтчество</th>\n",
       "      <th>Модальность</th>\n",
       "      <th>Дополнительные модальности</th>\n",
       "      <th>Ставка</th>\n",
       "      <th>Таб.\\n№</th>\n",
       "      <th>Unnamed: 5</th>\n",
       "      <th>Числа месяца</th>\n",
       "      <th>Unnamed: 7</th>\n",
       "      <th>Unnamed: 8</th>\n",
       "      <th>Unnamed: 9</th>\n",
       "      <th>...</th>\n",
       "      <th>Unnamed: 33</th>\n",
       "      <th>Unnamed: 34</th>\n",
       "      <th>Unnamed: 35</th>\n",
       "      <th>Unnamed: 36</th>\n",
       "      <th>Unnamed: 37</th>\n",
       "      <th>Unnamed: 38</th>\n",
       "      <th>Норма\\nчасов\\nпо\\nграфику</th>\n",
       "      <th>Норма\\nчасов за\\nполный\\nмесяц</th>\n",
       "      <th>Дата</th>\n",
       "      <th>Подпись</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>27</td>\n",
       "      <td>28.0</td>\n",
       "      <td>29</td>\n",
       "      <td>30.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>Итого за 2 пол. месяца</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Врач1</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ,ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>08:00</td>\n",
       "      <td>...</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>08:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>155.0</td>\n",
       "      <td>155.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>до</td>\n",
       "      <td>20:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20:30</td>\n",
       "      <td>...</td>\n",
       "      <td>20:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>перерыв</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>30</td>\n",
       "      <td>...</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1468</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1469</th>\n",
       "      <td>Врач368</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ, ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1470</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>до</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1471</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>перерыв</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1472</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1473 rows × 43 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Фамилия,\\nИмя,\\nОтчество Модальность  Дополнительные модальности  Ставка  \\\n",
       "0                         NaN         NaN                         NaN     NaN   \n",
       "1                       Врач1          РГ   КТ,ММГ,ФЛГ, Денситометрия     1.0   \n",
       "2                         NaN         NaN                         NaN     NaN   \n",
       "3                         NaN         NaN                         NaN     NaN   \n",
       "4                         NaN         NaN                         NaN     NaN   \n",
       "...                       ...         ...                         ...     ...   \n",
       "1468                      NaN         NaN                         NaN     NaN   \n",
       "1469                  Врач368          РГ  КТ, ММГ,ФЛГ, Денситометрия     1.0   \n",
       "1470                      NaN         NaN                         NaN     NaN   \n",
       "1471                      NaN         NaN                         NaN     NaN   \n",
       "1472                      NaN         NaN                         NaN     NaN   \n",
       "\n",
       "      Таб.\\n№ Unnamed: 5 Числа месяца  Unnamed: 7  Unnamed: 8 Unnamed: 9  ...  \\\n",
       "0         NaN        NaN            1         2.0         3.0          4  ...   \n",
       "1         NaN          с        08:00         NaN         NaN      08:00  ...   \n",
       "2         NaN         до        20:30         NaN         NaN      20:30  ...   \n",
       "3         NaN    перерыв           30         NaN         NaN         30  ...   \n",
       "4         NaN     отраб.           12         NaN         NaN         12  ...   \n",
       "...       ...        ...          ...         ...         ...        ...  ...   \n",
       "1468      NaN     отраб.          NaN         NaN         NaN        NaN  ...   \n",
       "1469      NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "1470      NaN         до          NaN         NaN         NaN        NaN  ...   \n",
       "1471      NaN    перерыв          NaN         NaN         NaN        NaN  ...   \n",
       "1472      NaN     отраб.          NaN         NaN         NaN        NaN  ...   \n",
       "\n",
       "      Unnamed: 33 Unnamed: 34 Unnamed: 35  Unnamed: 36  Unnamed: 37  \\\n",
       "0              27        28.0          29         30.0         31.0   \n",
       "1           08:00         NaN       08:00          NaN          NaN   \n",
       "2           20:30         NaN       20:30          NaN          NaN   \n",
       "3              30         NaN          30          NaN          NaN   \n",
       "4              12         NaN          12          NaN          NaN   \n",
       "...           ...         ...         ...          ...          ...   \n",
       "1468          NaN         NaN         NaN          NaN          NaN   \n",
       "1469          NaN         NaN         NaN          NaN          NaN   \n",
       "1470          NaN         NaN         NaN          NaN          NaN   \n",
       "1471          NaN         NaN         NaN          NaN          NaN   \n",
       "1472          NaN         NaN         NaN          NaN          NaN   \n",
       "\n",
       "                 Unnamed: 38 Норма\\nчасов\\nпо\\nграфику  \\\n",
       "0     Итого за 2 пол. месяца                       NaN   \n",
       "1                        NaN                     155.0   \n",
       "2                        NaN                       NaN   \n",
       "3                        NaN                       NaN   \n",
       "4                       72.0                       NaN   \n",
       "...                      ...                       ...   \n",
       "1468                     NaN                       NaN   \n",
       "1469                     NaN                       NaN   \n",
       "1470                     NaN                       NaN   \n",
       "1471                     NaN                       NaN   \n",
       "1472                     NaN                       NaN   \n",
       "\n",
       "      Норма\\nчасов за\\nполный\\nмесяц Дата  Подпись  \n",
       "0                                NaN  NaN      NaN  \n",
       "1                              155.0  NaN      NaN  \n",
       "2                                NaN  NaN      NaN  \n",
       "3                                NaN  NaN      NaN  \n",
       "4                                NaN  NaN      NaN  \n",
       "...                              ...  ...      ...  \n",
       "1468                             NaN  NaN      NaN  \n",
       "1469                             NaN  NaN      NaN  \n",
       "1470                             NaN  NaN      NaN  \n",
       "1471                             NaN  NaN      NaN  \n",
       "1472                             NaN  NaN      NaN  \n",
       "\n",
       "[1473 rows x 43 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solution_out = pd.read_excel('Data/solition_out.xlsx') # копия примера табеля\n",
    "solution_out"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1      08:00\n",
       "5        NaN\n",
       "9        NaN\n",
       "13       NaN\n",
       "17       NaN\n",
       "       ...  \n",
       "537      NaN\n",
       "541      NaN\n",
       "545      NaN\n",
       "549      NaN\n",
       "553      NaN\n",
       "Name: Числа месяца, Length: 139, dtype: object"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solution_out[\n",
    "        criteria.index[criteria][0]\n",
    "    ][1::4][:len(time['start'])]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '0:00'\n",
      " '16:00' '0:00' '8:00' '0:00' '16:00' None '8:00' '8:00' None '16:00'\n",
      " '0:00' '0:00' '16:00' '8:00' '0:00' '0:00' '0:00' None '0:00' '8:00'\n",
      " '16:00' '8:00' '0:00' '0:00' '0:00' None '8:00' '16:00' '8:00' None\n",
      " '8:00' '0:00' None '0:00' '16:00' '8:00' '16:00' '0:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '0:00' '0:00' '16:00' '8:00' '8:00' '0:00' None\n",
      " None '12:00' '0:00' '0:00' '0:00' '16:00' '12:00' '16:00' None '16:00'\n",
      " '0:00' '16:00' '0:00' '0:00' '0:00' None '16:00' '0:00' '0:00' '8:00'\n",
      " None '0:00' '16:00' '0:00' '16:00' '8:00' None '8:00' '0:00' None '8:00'\n",
      " '16:00' None '16:00' '16:00' '16:00' None '16:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '12:00' '0:00' None '0:00' '8:00' '0:00' None\n",
      " '16:00' '0:00' '0:00' None '16:00' None '16:00' None None '16:00' None\n",
      " None None '8:00' None None '0:00' '8:00' '8:00' '8:00' '16:00' '16:00'\n",
      " '0:00' '8:00' '0:00' '16:00' '16:00' '8:00' '0:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '8:30'\n",
      " '24:00' '8:30' '16:30' '8:30' '24:00' None '16:30' '16:30' None '24:00'\n",
      " '20:30' '8:30' '24:00' '16:30' '20:30' '8:30' '20:30' None '8:30' '16:30'\n",
      " '24:00' '16:30' '8:30' '8:30' '8:30' None '16:30' '24:00' '16:30' None\n",
      " '16:30' '8:30' None '8:30' '24:00' '16:30' '24:00' '8:30' '24:00' '16:30'\n",
      " '16:30' '24:00' '16:30' '8:30' '8:30' '24:00' '16:30' '16:30' '20:30'\n",
      " None None '24:00' '8:30' '20:30' '8:30' '24:00' '24:00' '24:00' None\n",
      " '24:00' '8:30' '24:00' '8:30' '8:30' '8:30' None '24:00' '8:30' '8:30'\n",
      " '16:30' None '8:30' '24:00' '8:30' '24:00' '16:30' None '16:30' '8:30'\n",
      " None '16:30' '24:00' None '24:00' '24:00' '24:00' None '24:00' '16:30'\n",
      " '24:00' '16:30' '16:30' '24:00' '16:30' '24:00' '8:30' None '8:30'\n",
      " '16:30' '8:30' None '24:00' '8:30' '20:30' None '24:00' None '24:00' None\n",
      " None '24:00' None None None '16:30' None None '8:30' '16:30' '16:30'\n",
      " '16:30' '24:00' '24:00' '8:30' '16:30' '8:30' '24:00' '24:00' '16:30'\n",
      " '20:30']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' None\n",
      " '16:00' '0:00' '8:00' None '16:00' '8:00' 'отпуск' '8:00' '8:00' '16:00'\n",
      " None None '16:00' '8:00' None None None '8:00' None '8:00' '16:00' '8:00'\n",
      " None None None '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '0:00' '16:00' '8:00' '16:00' None '16:00' '8:00' '8:00' '16:00' '8:00'\n",
      " '0:00' None '16:00' '8:00' '8:00' None '8:00' '8:00' None None None None\n",
      " '16:00' None '16:00' '8:00' '16:00' '0:00' '16:00' '0:00' '0:00' None\n",
      " '8:00' '16:00' None None '8:00' '8:00' '0:00' '16:00' '0:00' '16:00'\n",
      " '8:00' '8:00' '8:00' '0:00' '8:00' '8:00' '16:00' '8:00' '16:00' '16:00'\n",
      " '16:00' '8:00' '16:00' '8:00' '16:00' 'отпуск' '8:00' '16:00' '8:00' None\n",
      " None '8:00' '0:00' '8:00' '0:00' '8:00' '16:00' None None '8:00' '16:00'\n",
      " '8:00' '16:00' '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00'\n",
      " '8:00' '0:00' '8:00' '8:00' '8:00' '16:00' '16:00' None '8:00' '0:00'\n",
      " '16:00' '16:00' '8:00' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' None\n",
      " '24:00' '8:30' '16:30' None '24:00' '20:30' 'отпуск' '16:30' '20:30'\n",
      " '24:00' None None '24:00' '16:30' None None None '20:30' None '16:30'\n",
      " '24:00' '16:30' None None None '20:30' '16:30' '24:00' '16:30' '20:30'\n",
      " '16:30' '8:30' '20:30' '8:30' '24:00' '16:30' '24:00' None '24:00'\n",
      " '16:30' '16:30' '24:00' '16:30' '8:30' None '24:00' '16:30' '16:30' None\n",
      " '20:30' '20:30' None None None None '24:00' None '24:00' '20:30' '24:00'\n",
      " '8:30' '24:00' '8:30' '8:30' None '20:30' '24:00' None None '16:30'\n",
      " '20:30' '8:30' '24:00' '8:30' '24:00' '16:30' '20:30' '16:30' '8:30'\n",
      " '20:30' '16:30' '24:00' '20:30' '24:00' '24:00' '24:00' '20:30' '24:00'\n",
      " '16:30' '24:00' 'отпуск' '16:30' '24:00' '16:30' None None '20:30' '8:30'\n",
      " '16:30' '8:30' '20:30' '24:00' None None '20:30' '24:00' '20:30' '24:00'\n",
      " '20:30' '20:30' '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' '20:30'\n",
      " '8:30' '16:30' '16:30' '16:30' '24:00' '24:00' None '16:30' '8:30'\n",
      " '24:00' '24:00' '16:30' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '0:00'\n",
      " '16:00' '0:00' '8:00' '0:00' '16:00' '8:00' 'отпуск' '8:00' '8:00'\n",
      " '16:00' '0:00' '0:00' '16:00' '8:00' '0:00' '0:00' '0:00' '8:00' '0:00'\n",
      " '8:00' '16:00' '8:00' '0:00' '0:00' '0:00' '8:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '8:00' '0:00' '8:00' '0:00' '16:00' '8:00' '16:00' '0:00' '16:00'\n",
      " '8:00' '8:00' 'отпуск' '8:00' None '0:00' '16:00' '8:00' '8:00' '0:00'\n",
      " '8:00' '8:00' '12:00' '0:00' '0:00' '0:00' '16:00' '12:00' '16:00' '8:00'\n",
      " '16:00' '0:00' '16:00' '0:00' None '0:00' '8:00' '16:00' '0:00' '0:00'\n",
      " '8:00' '8:00' '0:00' '16:00' '0:00' '16:00' '8:00' '8:00' '8:00' None\n",
      " '8:00' '8:00' '16:00' '8:00' '16:00' '16:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '16:00' 'отпуск' '8:00' '16:00' '8:00' '12:00' '0:00' '8:00' None\n",
      " '8:00' None '8:00' '16:00' '0:00' '0:00' '8:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '0:00'\n",
      " '8:00' '8:00' '8:00' '16:00' '16:00' '0:00' '8:00' None '16:00' '16:00'\n",
      " '8:00' '0:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '8:30'\n",
      " '24:00' '8:30' '16:30' '8:30' '24:00' '20:30' 'отпуск' '16:30' '20:30'\n",
      " '24:00' '20:30' '8:30' '24:00' '16:30' '20:30' '8:30' '20:30' '20:30'\n",
      " '8:30' '16:30' '24:00' '16:30' '8:30' '8:30' '8:30' '20:30' '16:30'\n",
      " '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '8:30' '24:00' '16:30'\n",
      " '24:00' '8:30' '24:00' '16:30' '16:30' 'отпуск' '16:30' None '8:30'\n",
      " '24:00' '16:30' '16:30' '20:30' '20:30' '20:30' '24:00' '8:30' '20:30'\n",
      " '8:30' '24:00' '24:00' '24:00' '20:30' '24:00' '8:30' '24:00' '8:30' None\n",
      " '8:30' '20:30' '24:00' '8:30' '8:30' '16:30' '20:30' '8:30' '24:00'\n",
      " '8:30' '24:00' '16:30' '20:30' '16:30' None '20:30' '16:30' '24:00'\n",
      " '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '16:30' '24:00' 'отпуск'\n",
      " '16:30' '24:00' '16:30' '24:00' '8:30' '20:30' None '16:30' None '20:30'\n",
      " '24:00' '8:30' '20:30' '20:30' '24:00' '20:30' '24:00' '20:30' '20:30'\n",
      " '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' '20:30' '8:30' '16:30'\n",
      " '16:30' '16:30' '24:00' '24:00' '8:30' '16:30' None '24:00' '24:00'\n",
      " '16:30' '20:30']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '0:00'\n",
      " '16:00' '0:00' '8:00' '0:00' '16:00' '8:00' 'отпуск' '8:00' '8:00'\n",
      " '16:00' '0:00' '0:00' '16:00' '8:00' '0:00' '0:00' '0:00' '8:00' '0:00'\n",
      " '8:00' '16:00' '8:00' '0:00' '0:00' '0:00' '8:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '8:00' '0:00' '8:00' '0:00' '16:00' '8:00' '16:00' '0:00' '16:00'\n",
      " '8:00' '8:00' 'отпуск' '8:00' '0:00' '0:00' '16:00' '8:00' '8:00' '0:00'\n",
      " '8:00' '8:00' '0:00' '0:00' '0:00' '0:00' '16:00' '0:00' '16:00' '8:00'\n",
      " '16:00' '0:00' '16:00' '0:00' '0:00' '0:00' '8:00' '16:00' '0:00' '0:00'\n",
      " '8:00' '8:00' '0:00' '16:00' '0:00' '16:00' '8:00' '8:00' '8:00' '0:00'\n",
      " '8:00' '8:00' '16:00' '8:00' '16:00' '16:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '16:00' 'отпуск' '8:00' '16:00' '8:00' '0:00' '0:00' '8:00' '0:00'\n",
      " '8:00' '0:00' '8:00' '16:00' '0:00' '0:00' '8:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '0:00'\n",
      " '8:00' '8:00' '8:00' '16:00' '16:00' '0:00' '8:00' '0:00' '16:00' '16:00'\n",
      " '8:00' '0:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '8:30'\n",
      " '24:00' '8:30' '16:30' '8:30' '24:00' '20:30' 'отпуск' '16:30' '20:30'\n",
      " '24:00' '20:30' '8:30' '24:00' '16:30' '20:30' '8:30' '20:30' '20:30'\n",
      " '8:30' '16:30' '24:00' '16:30' '8:30' '8:30' '8:30' '20:30' '16:30'\n",
      " '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '8:30' '24:00' '16:30'\n",
      " '24:00' '8:30' '24:00' '16:30' '16:30' 'отпуск' '16:30' '8:30' '8:30'\n",
      " '24:00' '16:30' '16:30' '20:30' '20:30' '20:30' '12:30' '8:30' '20:30'\n",
      " '8:30' '24:00' '12:30' '24:00' '20:30' '24:00' '8:30' '24:00' '8:30'\n",
      " '8:30' '8:30' '20:30' '24:00' '8:30' '8:30' '16:30' '20:30' '8:30'\n",
      " '24:00' '8:30' '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '16:30'\n",
      " '24:00' '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '16:30' '24:00'\n",
      " 'отпуск' '16:30' '24:00' '16:30' '12:30' '8:30' '20:30' '8:30' '16:30'\n",
      " '8:30' '20:30' '24:00' '8:30' '20:30' '20:30' '24:00' '20:30' '24:00'\n",
      " '20:30' '20:30' '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' '20:30'\n",
      " '8:30' '16:30' '16:30' '16:30' '24:00' '24:00' '8:30' '16:30' '8:30'\n",
      " '24:00' '24:00' '16:30' '20:30']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' None '16:00'\n",
      " '0:00' '8:00' None '16:00' None 'отпуск' '8:00' None '16:00' None None\n",
      " '16:00' '8:00' None None None None None '8:00' '16:00' '8:00' None None\n",
      " None None '8:00' '16:00' '8:00' None '8:00' '0:00' None '0:00' '16:00'\n",
      " '8:00' '16:00' None '16:00' '8:00' '8:00' 'отпуск' '8:00' '0:00' None\n",
      " '16:00' '8:00' '8:00' None None None '12:00' None None None '16:00'\n",
      " '12:00' '16:00' None '16:00' '0:00' '16:00' '0:00' '0:00' None None\n",
      " '16:00' None None '8:00' None '0:00' '16:00' '0:00' '16:00' '8:00' None\n",
      " '8:00' '0:00' None '8:00' '16:00' None '16:00' '16:00' '16:00' None\n",
      " '16:00' '8:00' '16:00' 'отпуск' '8:00' '16:00' '8:00' '12:00' None None\n",
      " '0:00' '8:00' '0:00' None '16:00' None None None '16:00' None '16:00'\n",
      " None None '16:00' None None None '8:00' None None '0:00' '8:00' '8:00'\n",
      " '8:00' '16:00' '16:00' None '8:00' '0:00' '16:00' '16:00' '8:00' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' None '24:00'\n",
      " '8:30' '16:30' None '24:00' None 'отпуск' '16:30' None '24:00' None None\n",
      " '24:00' '16:30' None None None None None '16:30' '24:00' '16:30' None\n",
      " None None None '16:30' '24:00' '16:30' None '16:30' '8:30' None '8:30'\n",
      " '24:00' '16:30' '24:00' None '24:00' '16:30' '16:30' 'отпуск' '16:30'\n",
      " '8:30' None '24:00' '16:30' '16:30' None None None '24:00' None None None\n",
      " '24:00' '24:00' '24:00' None '24:00' '8:30' '24:00' '8:30' '8:30' None\n",
      " None '24:00' None None '16:30' None '8:30' '24:00' '8:30' '24:00' '16:30'\n",
      " None '16:30' '8:30' None '16:30' '24:00' None '24:00' '24:00' '24:00'\n",
      " None '24:00' '16:30' '24:00' 'отпуск' '16:30' '24:00' '16:30' '24:00'\n",
      " None None '8:30' '16:30' '8:30' None '24:00' None None None '24:00' None\n",
      " '24:00' None None '24:00' None None None '16:30' None None '8:30' '16:30'\n",
      " '16:30' '16:30' '24:00' '24:00' None '16:30' '8:30' '24:00' '24:00'\n",
      " '16:30' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '8:00'\n",
      " '16:00' '0:00' '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '16:00'\n",
      " '20:00' '8:00' '16:00' '8:00' '20:00' '8:00' '20:00' '8:00' '8:00' '8:00'\n",
      " '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '16:00' '8:00' '8:00'\n",
      " '8:00' '0:00' '8:00' '0:00' '16:00' '8:00' '16:00' '8:00' '16:00' '8:00'\n",
      " '8:00' 'отпуск' '8:00' '0:00' '8:00' '16:00' '8:00' '8:00' '20:00' '8:00'\n",
      " '8:00' None '8:00' '20:00' '8:00' '16:00' None '16:00' '8:00' '16:00'\n",
      " '0:00' '16:00' '0:00' '0:00' '8:00' '8:00' '16:00' '8:00' '8:00' '8:00'\n",
      " '8:00' '0:00' '16:00' '0:00' '16:00' '8:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '8:00' 'отпуск' '8:00' '16:00' '16:00' '16:00' '8:00' '16:00' '8:00'\n",
      " '16:00' '8:00' '8:00' '16:00' '8:00' None '8:00' '8:00' '0:00' '8:00'\n",
      " '0:00' '8:00' '16:00' '8:00' '20:00' '8:00' '16:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '8:00' '8:00' '16:00' '16:00' '8:00' '8:00' '0:00' '16:00' '16:00' '8:00'\n",
      " '20:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00'\n",
      " '24:00' '8:30' '16:30' '24:00' '24:00' '20:30' '16:30' '16:30' '20:30'\n",
      " '24:00' '24:00' '24:00' '24:00' '16:30' '24:00' '24:00' '24:00' '20:30'\n",
      " '24:00' '16:30' '24:00' '16:30' '24:00' '24:00' '24:00' '20:30' '16:30'\n",
      " '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '8:30' '24:00' '16:30'\n",
      " '24:00' '24:00' '24:00' '16:30' '16:30' 'отпуск' '16:30' '8:30' '24:00'\n",
      " '24:00' '16:30' '16:30' '24:00' '20:30' '20:30' None '24:00' '24:00'\n",
      " '24:00' '24:00' None '24:00' '20:30' '24:00' '8:30' '24:00' '8:30' '8:30'\n",
      " '24:00' '20:30' '24:00' '24:00' '24:00' '16:30' '20:30' '8:30' '24:00'\n",
      " '8:30' '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '16:30' 'отпуск'\n",
      " '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '16:30' '24:00' '16:30'\n",
      " '16:30' '24:00' '16:30' None '24:00' '20:30' '8:30' '16:30' '8:30'\n",
      " '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '20:30' '24:00' '20:30'\n",
      " '20:30' '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' '20:30' '8:30'\n",
      " '16:30' '16:30' '16:30' '24:00' '24:00' '24:00' '16:30' '8:30' '24:00'\n",
      " '24:00' '16:30' '24:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' None\n",
      " '16:00' '0:00' '8:00' None '16:00' '8:00' '8:00' '8:00' '8:00' '16:00'\n",
      " None None '16:00' '8:00' None None None '8:00' None '8:00' '16:00' '8:00'\n",
      " None None None '8:00' '8:00' '16:00' 'отпуск' '8:00' '8:00' '0:00' '8:00'\n",
      " '0:00' '16:00' '8:00' '16:00' None '16:00' '8:00' '8:00' '16:00' '8:00'\n",
      " None None '16:00' '8:00' '8:00' None '8:00' '8:00' '12:00' None None None\n",
      " '16:00' '12:00' '16:00' '8:00' '16:00' '0:00' '16:00' '0:00' None None\n",
      " '8:00' '16:00' None None '8:00' '8:00' '0:00' '16:00' '0:00' '16:00'\n",
      " '8:00' '8:00' '8:00' None '8:00' '8:00' 'отпуск' '8:00' '16:00' '16:00'\n",
      " 'отпуск' '8:00' '16:00' '8:00' '16:00' '8:00' '8:00' '16:00' '8:00'\n",
      " '12:00' None '8:00' None '8:00' None '8:00' '16:00' None None '8:00'\n",
      " '16:00' 'отпуск' '16:00' '8:00' '8:00' '16:00' '8:00' '8:00' '8:00'\n",
      " '8:00' '8:00' '8:00' '0:00' '8:00' '8:00' '8:00' '16:00' '16:00' None\n",
      " '8:00' None '16:00' '16:00' '8:00' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' None\n",
      " '24:00' '8:30' '16:30' None '24:00' '20:30' '16:30' '16:30' '20:30'\n",
      " '24:00' None None '24:00' '16:30' None None None '20:30' None '16:30'\n",
      " '24:00' '16:30' None None None '20:30' '16:30' '24:00' 'отпуск' '20:30'\n",
      " '16:30' '8:30' '20:30' '8:30' '24:00' '16:30' '24:00' None '24:00'\n",
      " '16:30' '16:30' '24:00' '16:30' None None '24:00' '16:30' '16:30' None\n",
      " '20:30' '20:30' '24:00' None None None '24:00' '24:00' '24:00' '20:30'\n",
      " '24:00' '8:30' '24:00' '8:30' None None '20:30' '24:00' None None '16:30'\n",
      " '20:30' '8:30' '24:00' '8:30' '24:00' '16:30' '20:30' '16:30' None\n",
      " '20:30' '16:30' 'отпуск' '20:30' '24:00' '24:00' 'отпуск' '20:30' '24:00'\n",
      " '16:30' '24:00' '16:30' '16:30' '24:00' '16:30' '24:00' None '20:30' None\n",
      " '16:30' None '20:30' '24:00' None None '20:30' '24:00' 'отпуск' '24:00'\n",
      " '20:30' '20:30' '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' '20:30'\n",
      " '8:30' '16:30' '16:30' '16:30' '24:00' '24:00' None '16:30' None '24:00'\n",
      " '24:00' '16:30' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None None None None None None None None '0:00' None None None '0:00' None\n",
      " None None None None None '0:00' '0:00' 'отпуск' None '0:00' '0:00' '0:00'\n",
      " None '0:00' None None None '0:00' '0:00' '0:00' None None None 'отпуск'\n",
      " None None None None None None None None '0:00' None None None None None\n",
      " '0:00' '0:00' None None None '0:00' None None None '0:00' '0:00' '0:00'\n",
      " None None None None None None None None '0:00' '0:00' None None '0:00'\n",
      " '0:00' None None None None None None None None None '0:00' None None\n",
      " 'отпуск' None None None 'отпуск' None None None None None None None None\n",
      " None '0:00' None '0:00' None '0:00' None None '0:00' '0:00' None None\n",
      " 'отпуск' None None None None None None None None None None None None None\n",
      " None None None '0:00' None '0:00' None None None '0:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None None None None None None None None '8:30' None None None '8:30' None\n",
      " None None None None None '20:30' '8:30' 'отпуск' None '20:30' '8:30'\n",
      " '20:30' None '8:30' None None None '8:30' '8:30' '8:30' None None None\n",
      " 'отпуск' None None None None None None None None '8:30' None None None\n",
      " None None '8:30' '8:30' None None None '20:30' None None None '8:30'\n",
      " '20:30' '8:30' None None None None None None None None '8:30' '8:30' None\n",
      " None '8:30' '8:30' None None None None None None None None None '8:30'\n",
      " None None 'отпуск' None None None 'отпуск' None None None None None None\n",
      " None None None '8:30' None '8:30' None '8:30' None None '8:30' '20:30'\n",
      " None None 'отпуск' None None None None None None None None None None None\n",
      " None None None None None '8:30' None '8:30' None None None '20:30']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '8:00'\n",
      " '16:00' '0:00' '8:00' '8:00' '16:00' None '8:00' '8:00' None '16:00'\n",
      " '20:00' '8:00' 'отпуск' '8:00' '20:00' '8:00' '20:00' None '8:00' '8:00'\n",
      " '16:00' '8:00' '8:00' '8:00' '8:00' None '8:00' '16:00' 'отпуск' None\n",
      " '8:00' '0:00' None '0:00' '16:00' '8:00' '16:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '0:00' '8:00' '16:00' '8:00' '8:00' '20:00' None\n",
      " None '12:00' '8:00' '20:00' '8:00' '16:00' '12:00' '16:00' None '16:00'\n",
      " '0:00' '16:00' '0:00' '0:00' '8:00' None '16:00' '8:00' '8:00' '8:00'\n",
      " None '0:00' '16:00' '0:00' '16:00' '8:00' None '8:00' '0:00' None '8:00'\n",
      " 'отпуск' None '16:00' '16:00' 'отпуск' None '16:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '12:00' '8:00' None '0:00' '8:00' '0:00' None\n",
      " '16:00' '8:00' '20:00' None '16:00' 'отпуск' '16:00' None None '16:00'\n",
      " None None None '8:00' None None '0:00' '8:00' '8:00' '8:00' '16:00'\n",
      " '16:00' '8:00' '8:00' '0:00' '16:00' '16:00' '8:00' '20:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00'\n",
      " '24:00' '8:30' '16:30' '24:00' '24:00' None '16:30' '16:30' None '24:00'\n",
      " '24:00' '24:00' 'отпуск' '16:30' '24:00' '24:00' '24:00' None '24:00'\n",
      " '16:30' '24:00' '16:30' '24:00' '24:00' '24:00' None '16:30' '24:00'\n",
      " 'отпуск' None '16:30' '8:30' None '8:30' '24:00' '16:30' '24:00' '24:00'\n",
      " '24:00' '16:30' '16:30' '24:00' '16:30' '8:30' '24:00' '24:00' '16:30'\n",
      " '16:30' '24:00' None None '24:00' '24:00' '24:00' '24:00' '24:00' '24:00'\n",
      " '24:00' None '24:00' '8:30' '24:00' '8:30' '8:30' '24:00' None '24:00'\n",
      " '24:00' '24:00' '16:30' None '8:30' '24:00' '8:30' '24:00' '16:30' None\n",
      " '16:30' '8:30' None '16:30' 'отпуск' None '24:00' '24:00' 'отпуск' None\n",
      " '24:00' '16:30' '24:00' '16:30' '16:30' '24:00' '16:30' '24:00' '24:00'\n",
      " None '8:30' '16:30' '8:30' None '24:00' '24:00' '24:00' None '24:00'\n",
      " 'отпуск' '24:00' None None '24:00' None None None '16:30' None None\n",
      " '8:30' '16:30' '16:30' '16:30' '24:00' '24:00' '24:00' '16:30' '8:30'\n",
      " '24:00' '24:00' '16:30' '24:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '0:00'\n",
      " '16:00' '0:00' '8:00' '0:00' '16:00' '8:00' '8:00' '8:00' '8:00' '16:00'\n",
      " '0:00' '0:00' 'отпуск' '8:00' '0:00' '0:00' '0:00' '8:00' '0:00' '8:00'\n",
      " '16:00' '8:00' '0:00' '0:00' '0:00' '8:00' '8:00' '16:00' 'отпуск' '8:00'\n",
      " '8:00' '0:00' '8:00' '0:00' '16:00' '8:00' '16:00' '0:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '0:00' '0:00' '16:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '8:00' None '0:00' '0:00' '0:00' '16:00' None '16:00' '8:00' '16:00'\n",
      " '0:00' '16:00' '0:00' '0:00' '0:00' '8:00' '16:00' '0:00' '0:00' '8:00'\n",
      " '8:00' '0:00' '16:00' '0:00' '16:00' '8:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '16:00' '16:00' 'отпуск' '8:00' '16:00' '8:00'\n",
      " '16:00' '8:00' '8:00' '16:00' '8:00' None '0:00' '8:00' '0:00' '8:00'\n",
      " '0:00' '8:00' '16:00' '0:00' '0:00' '8:00' '16:00' 'отпуск' '16:00'\n",
      " '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '0:00'\n",
      " '8:00' '8:00' '8:00' '16:00' '16:00' '0:00' '8:00' '0:00' '16:00' '16:00'\n",
      " '8:00' '0:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '8:30'\n",
      " '24:00' '8:30' '16:30' '8:30' '24:00' '20:30' '16:30' '16:30' '20:30'\n",
      " '24:00' '20:30' '8:30' 'отпуск' '16:30' '20:30' '8:30' '20:30' '20:30'\n",
      " '8:30' '16:30' '24:00' '16:30' '8:30' '8:30' '8:30' '20:30' '16:30'\n",
      " '24:00' 'отпуск' '20:30' '16:30' '8:30' '20:30' '8:30' '24:00' '16:30'\n",
      " '24:00' '8:30' '24:00' '16:30' '16:30' '24:00' '16:30' '8:30' '8:30'\n",
      " '24:00' '16:30' '16:30' '20:30' '20:30' '20:30' None '8:30' '20:30'\n",
      " '8:30' '24:00' None '24:00' '20:30' '24:00' '8:30' '24:00' '8:30' '8:30'\n",
      " '8:30' '20:30' '24:00' '8:30' '8:30' '16:30' '20:30' '8:30' '24:00'\n",
      " '8:30' '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '16:30' '24:00'\n",
      " '20:30' '24:00' '24:00' 'отпуск' '20:30' '24:00' '16:30' '24:00' '16:30'\n",
      " '16:30' '24:00' '16:30' None '8:30' '20:30' '8:30' '16:30' '8:30' '20:30'\n",
      " '24:00' '8:30' '20:30' '20:30' '24:00' 'отпуск' '24:00' '20:30' '20:30'\n",
      " '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' '20:30' '8:30' '16:30'\n",
      " '16:30' '16:30' '24:00' '24:00' '8:30' '16:30' '8:30' '24:00' '24:00'\n",
      " '16:30' '20:30']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '8:00'\n",
      " '16:00' '0:00' '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '16:00'\n",
      " '20:00' '8:00' 'отпуск' '8:00' '20:00' '8:00' '20:00' '8:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '8:00' '0:00' '8:00' '0:00' '16:00' '8:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '8:00' '16:00' '8:00' None '8:00' '16:00' '8:00' '8:00' '20:00'\n",
      " '8:00' '8:00' '12:00' '8:00' '20:00' '8:00' '16:00' '12:00' '16:00'\n",
      " '8:00' '16:00' '0:00' '16:00' '0:00' None '8:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '8:00' '8:00' '0:00' '16:00' '0:00' '16:00' '8:00' '8:00' '8:00'\n",
      " None '8:00' '8:00' '16:00' '8:00' '16:00' '16:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '16:00' '8:00' '8:00' '16:00' '8:00' '12:00' '8:00' '8:00' None\n",
      " '8:00' None '8:00' '16:00' '8:00' '20:00' '8:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '0:00'\n",
      " '8:00' '8:00' '8:00' '16:00' '16:00' '8:00' '8:00' None '16:00' '16:00'\n",
      " '8:00' '20:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00'\n",
      " '24:00' '8:30' '16:30' '24:00' '24:00' '20:30' '16:30' '16:30' '20:30'\n",
      " '24:00' '24:00' '24:00' 'отпуск' '16:30' '24:00' '24:00' '24:00' '20:30'\n",
      " '24:00' '16:30' '24:00' '16:30' '24:00' '24:00' '24:00' '20:30' '16:30'\n",
      " '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '8:30' '24:00' '16:30'\n",
      " '24:00' '24:00' '24:00' '16:30' '16:30' '24:00' '16:30' None '24:00'\n",
      " '24:00' '16:30' '16:30' '24:00' '20:30' '20:30' '24:00' '24:00' '24:00'\n",
      " '24:00' '24:00' '24:00' '24:00' '20:30' '24:00' '8:30' '24:00' '8:30'\n",
      " None '24:00' '20:30' '24:00' '24:00' '24:00' '16:30' '20:30' '8:30'\n",
      " '24:00' '8:30' '24:00' '16:30' '20:30' '16:30' None '20:30' '16:30'\n",
      " '24:00' '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '16:30' '24:00'\n",
      " '16:30' '16:30' '24:00' '16:30' '24:00' '24:00' '20:30' None '16:30' None\n",
      " '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '20:30' '24:00' '20:30'\n",
      " '20:30' '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' '20:30' '8:30'\n",
      " '16:30' '16:30' '16:30' '24:00' '24:00' '24:00' '16:30' None '24:00'\n",
      " '24:00' '16:30' '24:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None None None None None None None None None None None None None None\n",
      " None None None None None None None None None None None None None None\n",
      " None None None None None None None None None None None None None None\n",
      " None None None None None None None None None None '0:00' None None None\n",
      " None None None None None None None None None None None None None None\n",
      " None None '0:00' None None None None None None None None None None None\n",
      " None None None '0:00' None None None None None None None None None None\n",
      " None None None None None None None None '0:00' None '0:00' None None None\n",
      " None None None None None None None None None None None None None 'отпуск'\n",
      " None None None None None None None None '0:00' None None None None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None None None None None None None None None None None None None None\n",
      " None None None None None None None None None None None None None None\n",
      " None None None None None None None None None None None None None None\n",
      " None None None None None None None None None None '8:30' None None None\n",
      " None None None None None None None None None None None None None None\n",
      " None None '8:30' None None None None None None None None None None None\n",
      " None None None '8:30' None None None None None None None None None None\n",
      " None None None None None None None None '8:30' None '8:30' None None None\n",
      " None None None None None None None None None None None None None 'отпуск'\n",
      " None None None None None None None None '8:30' None None None None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '0:00'\n",
      " '16:00' '0:00' '8:00' '0:00' '16:00' None '8:00' '8:00' None '16:00'\n",
      " '0:00' '0:00' '16:00' '8:00' '0:00' '0:00' '0:00' None '0:00' '8:00'\n",
      " '16:00' '8:00' '0:00' '0:00' '0:00' None '8:00' '16:00' '8:00' None\n",
      " '8:00' '0:00' None '0:00' '16:00' '8:00' '16:00' '0:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '0:00' '0:00' '16:00' '8:00' '8:00' '0:00' None\n",
      " None '12:00' '0:00' '0:00' '0:00' '16:00' '12:00' '16:00' None '16:00'\n",
      " '0:00' '16:00' '0:00' '0:00' '0:00' None '16:00' '0:00' '0:00' '8:00'\n",
      " None '0:00' '16:00' '0:00' '16:00' '8:00' None '8:00' '0:00' None '8:00'\n",
      " '16:00' None '16:00' '16:00' '16:00' None '16:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '12:00' '0:00' None '0:00' '8:00' '0:00' None\n",
      " '16:00' '0:00' '0:00' None '16:00' None '16:00' None None '16:00' None\n",
      " None None '8:00' None 'отпуск' '0:00' '8:00' '8:00' '8:00' '16:00'\n",
      " '16:00' '0:00' '8:00' '0:00' '16:00' '16:00' '8:00' '0:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '8:30'\n",
      " '24:00' '8:30' '16:30' '8:30' '24:00' None '16:30' '16:30' None '24:00'\n",
      " '20:30' '8:30' '24:00' '16:30' '20:30' '8:30' '20:30' None '8:30' '16:30'\n",
      " '24:00' '16:30' '8:30' '8:30' '8:30' None '16:30' '24:00' '16:30' None\n",
      " '16:30' '8:30' None '8:30' '24:00' '16:30' '24:00' '8:30' '24:00' '16:30'\n",
      " '16:30' '24:00' '16:30' '8:30' '8:30' '24:00' '16:30' '16:30' '20:30'\n",
      " None None '24:00' '8:30' '20:30' '8:30' '24:00' '24:00' '24:00' None\n",
      " '24:00' '8:30' '24:00' '8:30' '8:30' '8:30' None '24:00' '8:30' '8:30'\n",
      " '16:30' None '8:30' '24:00' '8:30' '24:00' '16:30' None '16:30' '8:30'\n",
      " None '16:30' '24:00' None '24:00' '24:00' '24:00' None '24:00' '16:30'\n",
      " '24:00' '16:30' '16:30' '24:00' '16:30' '24:00' '8:30' None '8:30'\n",
      " '16:30' '8:30' None '24:00' '8:30' '20:30' None '24:00' None '24:00' None\n",
      " None '24:00' None None None '16:30' None 'отпуск' '8:30' '16:30' '16:30'\n",
      " '16:30' '24:00' '24:00' '8:30' '16:30' '8:30' '24:00' '24:00' '16:30'\n",
      " '20:30']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' None\n",
      " '16:00' '0:00' '8:00' None '16:00' '8:00' '8:00' '8:00' '8:00' '16:00'\n",
      " None None '16:00' '8:00' None None None '8:00' None '8:00' '16:00' '8:00'\n",
      " None None None '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '0:00' '16:00' '8:00' '16:00' None '16:00' '8:00' '8:00' '16:00' '8:00'\n",
      " '0:00' None '16:00' '8:00' '8:00' None '8:00' '8:00' None None None None\n",
      " '16:00' None 'отпуск' '8:00' '16:00' '0:00' '16:00' '0:00' '0:00' None\n",
      " '8:00' '16:00' None None '8:00' '8:00' '0:00' '16:00' '0:00' '16:00'\n",
      " '8:00' '8:00' '8:00' '0:00' '8:00' '8:00' '16:00' '8:00' '16:00' '16:00'\n",
      " '16:00' '8:00' '16:00' '8:00' '16:00' '8:00' '8:00' '16:00' '8:00' None\n",
      " None '8:00' '0:00' '8:00' '0:00' '8:00' '16:00' None None '8:00' '16:00'\n",
      " '8:00' '16:00' '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00'\n",
      " 'отпуск' '0:00' '8:00' '8:00' '8:00' '16:00' '16:00' None '8:00' '0:00'\n",
      " '16:00' '16:00' '8:00' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' None\n",
      " '24:00' '8:30' '16:30' None '24:00' '20:30' '16:30' '16:30' '20:30'\n",
      " '24:00' None None '24:00' '16:30' None None None '20:30' None '16:30'\n",
      " '24:00' '16:30' None None None '20:30' '16:30' '24:00' '16:30' '20:30'\n",
      " '16:30' '8:30' '20:30' '8:30' '24:00' '16:30' '24:00' None '24:00'\n",
      " '16:30' '16:30' '24:00' '16:30' '8:30' None '24:00' '16:30' '16:30' None\n",
      " '20:30' '20:30' None None None None '24:00' None 'отпуск' '20:30' '24:00'\n",
      " '8:30' '24:00' '8:30' '8:30' None '20:30' '24:00' None None '16:30'\n",
      " '20:30' '8:30' '24:00' '8:30' '24:00' '16:30' '20:30' '16:30' '8:30'\n",
      " '20:30' '16:30' '24:00' '20:30' '24:00' '24:00' '24:00' '20:30' '24:00'\n",
      " '16:30' '24:00' '16:30' '16:30' '24:00' '16:30' None None '20:30' '8:30'\n",
      " '16:30' '8:30' '20:30' '24:00' None None '20:30' '24:00' '20:30' '24:00'\n",
      " '20:30' '20:30' '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' 'отпуск'\n",
      " '8:30' '16:30' '16:30' '16:30' '24:00' '24:00' None '16:30' '8:30'\n",
      " '24:00' '24:00' '16:30' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '0:00'\n",
      " '16:00' '0:00' '8:00' '0:00' '16:00' '8:00' '8:00' '8:00' '8:00' '16:00'\n",
      " '0:00' '0:00' '16:00' '8:00' '0:00' '0:00' '0:00' '8:00' '0:00' '8:00'\n",
      " '16:00' '8:00' '0:00' '0:00' '0:00' '8:00' '8:00' '16:00' '8:00' '8:00'\n",
      " '8:00' '0:00' '8:00' '0:00' '16:00' '8:00' '16:00' '0:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' None '0:00' '16:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '8:00' '12:00' '0:00' '0:00' '0:00' '16:00' '12:00' 'отпуск' '8:00'\n",
      " '16:00' '0:00' '16:00' '0:00' None '0:00' '8:00' '16:00' '0:00' '0:00'\n",
      " '8:00' '8:00' '0:00' '16:00' '0:00' '16:00' '8:00' '8:00' '8:00' None\n",
      " '8:00' '8:00' '16:00' '8:00' '16:00' '16:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '16:00' '8:00' '8:00' '16:00' '8:00' '12:00' '0:00' '8:00' None\n",
      " '8:00' None '8:00' '16:00' '0:00' '0:00' '8:00' '16:00' '8:00' '16:00'\n",
      " '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' 'отпуск' '0:00'\n",
      " '8:00' '8:00' '8:00' '16:00' '16:00' '0:00' '8:00' None '16:00' '16:00'\n",
      " '8:00' '0:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '8:30'\n",
      " '24:00' '8:30' '16:30' '8:30' '24:00' '20:30' '16:30' '16:30' '20:30'\n",
      " '24:00' '20:30' '8:30' '24:00' '16:30' '20:30' '8:30' '20:30' '20:30'\n",
      " '8:30' '16:30' '24:00' '16:30' '8:30' '8:30' '8:30' '20:30' '16:30'\n",
      " '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '8:30' '24:00' '16:30'\n",
      " '24:00' '8:30' '24:00' '16:30' '16:30' '24:00' '16:30' None '8:30'\n",
      " '24:00' '16:30' '16:30' '20:30' '20:30' '20:30' '24:00' '8:30' '20:30'\n",
      " '8:30' '24:00' '24:00' 'отпуск' '20:30' '24:00' '8:30' '24:00' '8:30'\n",
      " None '8:30' '20:30' '24:00' '8:30' '8:30' '16:30' '20:30' '8:30' '24:00'\n",
      " '8:30' '24:00' '16:30' '20:30' '16:30' None '20:30' '16:30' '24:00'\n",
      " '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '16:30' '24:00' '16:30'\n",
      " '16:30' '24:00' '16:30' '24:00' '8:30' '20:30' None '16:30' None '20:30'\n",
      " '24:00' '8:30' '20:30' '20:30' '24:00' '20:30' '24:00' '20:30' '20:30'\n",
      " '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' 'отпуск' '8:30' '16:30'\n",
      " '16:30' '16:30' '24:00' '24:00' '8:30' '16:30' None '24:00' '24:00'\n",
      " '16:30' '20:30']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None None None None None None None None '8:00' None None None '8:00' None\n",
      " None None None None None '20:00' '8:00' None None '20:00' '8:00' '20:00'\n",
      " None '8:00' None None None '8:00' '8:00' '8:00' None None None None None\n",
      " None None None None None None None '8:00' None None None None None '0:00'\n",
      " '8:00' None None None '20:00' None None None '8:00' '20:00' '8:00' None\n",
      " None 'отпуск' None None None None None '0:00' '8:00' None None '8:00'\n",
      " '8:00' None None None None None None None None None '0:00' None None None\n",
      " None None None None None None None None None None None None None '8:00'\n",
      " None '0:00' None '0:00' None None '8:00' '20:00' None None None None None\n",
      " None None None None None None None None None None None None None None\n",
      " '8:00' None '0:00' None None None '20:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None None None None None None None None '24:00' None None None '24:00'\n",
      " None None None None None None '24:00' '24:00' None None '24:00' '24:00'\n",
      " '24:00' None '24:00' None None None '24:00' '24:00' '24:00' None None\n",
      " None None None None None None None None None None '24:00' None None None\n",
      " None None '8:30' '24:00' None None None '24:00' None None None '24:00'\n",
      " '24:00' '24:00' None None 'отпуск' None None None None None '8:30'\n",
      " '24:00' None None '24:00' '24:00' None None None None None None None None\n",
      " None '8:30' None None None None None None None None None None None None\n",
      " None None None None '24:00' None '8:30' None '8:30' None None '24:00'\n",
      " '24:00' None None None None None None None None None None None None None\n",
      " None None None None None None '24:00' None '8:30' None None None '24:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' None '16:00'\n",
      " '0:00' '8:00' None '16:00' None '8:00' '8:00' None '16:00' None None\n",
      " '16:00' '8:00' None None None None None '8:00' '16:00' '8:00' None None\n",
      " None None '8:00' '16:00' '8:00' None '8:00' '0:00' None '0:00' '16:00'\n",
      " '8:00' '16:00' None '16:00' '8:00' '8:00' '16:00' '8:00' '0:00' None\n",
      " '16:00' '8:00' '8:00' None None None '12:00' None None None '16:00'\n",
      " '12:00' 'отпуск' None '16:00' '0:00' '16:00' '0:00' '0:00' None None\n",
      " '16:00' None None '8:00' None '0:00' '16:00' '0:00' '16:00' '8:00' None\n",
      " '8:00' '0:00' None '8:00' '16:00' None '16:00' '16:00' '16:00' None\n",
      " '16:00' '8:00' '16:00' '8:00' '8:00' '16:00' '8:00' '12:00' None None\n",
      " '0:00' '8:00' '0:00' None '16:00' None None None '16:00' None '16:00'\n",
      " None None '16:00' None None None '8:00' None None '0:00' '8:00' '8:00'\n",
      " '8:00' '16:00' '16:00' None '8:00' '0:00' '16:00' '16:00' '8:00' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[None '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' None '24:00'\n",
      " '8:30' '16:30' None '24:00' None '16:30' '16:30' None '24:00' None None\n",
      " '24:00' '16:30' None None None None None '16:30' '24:00' '16:30' None\n",
      " None None None '16:30' '24:00' '16:30' None '16:30' '8:30' None '8:30'\n",
      " '24:00' '16:30' '24:00' None '24:00' '16:30' '16:30' '24:00' '16:30'\n",
      " '8:30' None '24:00' '16:30' '16:30' None None None '24:00' None None None\n",
      " '24:00' '24:00' 'отпуск' None '24:00' '8:30' '24:00' '8:30' '8:30' None\n",
      " None '24:00' None None '16:30' None '8:30' '24:00' '8:30' '24:00' '16:30'\n",
      " None '16:30' '8:30' None '16:30' '24:00' None '24:00' '24:00' '24:00'\n",
      " None '24:00' '16:30' '24:00' '16:30' '16:30' '24:00' '16:30' '24:00' None\n",
      " None '8:30' '16:30' '8:30' None '24:00' None None None '24:00' None\n",
      " '24:00' None None '24:00' None None None '16:30' None None '8:30' '16:30'\n",
      " '16:30' '16:30' '24:00' '24:00' None '16:30' '8:30' '24:00' '24:00'\n",
      " '16:30' None]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:20: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['8:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '16:00' '8:00'\n",
      " '16:00' '0:00' '8:00' '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '16:00'\n",
      " '20:00' '8:00' '16:00' '8:00' '20:00' '8:00' '20:00' '8:00' '8:00' '8:00'\n",
      " '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '16:00' '8:00' '8:00'\n",
      " '8:00' '0:00' '8:00' '0:00' '16:00' '8:00' '16:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '0:00' '8:00' '16:00' '8:00' '8:00' '20:00' '8:00'\n",
      " '8:00' None '8:00' '20:00' '8:00' '16:00' None '16:00' '8:00' '16:00'\n",
      " '0:00' '16:00' '0:00' '0:00' '8:00' '8:00' '16:00' '8:00' '8:00' '8:00'\n",
      " '8:00' '0:00' '16:00' '0:00' '16:00' '8:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '16:00' '16:00' '16:00' '8:00' '16:00' '8:00'\n",
      " '16:00' '8:00' '8:00' '16:00' '8:00' None '8:00' '8:00' '0:00' '8:00'\n",
      " '0:00' '8:00' '16:00' '8:00' '20:00' '8:00' '16:00' '8:00' '16:00' '8:00'\n",
      " '8:00' '16:00' '8:00' '8:00' '8:00' '8:00' '8:00' '8:00' '0:00' '8:00'\n",
      " '8:00' '8:00' '16:00' '16:00' '8:00' '8:00' '0:00' '16:00' '16:00' '8:00'\n",
      " '20:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n",
      "/tmp/ipykernel_15494/1818462707.py:23: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '['20:30' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00' '24:00'\n",
      " '24:00' '8:30' '16:30' '24:00' '24:00' '20:30' '16:30' '16:30' '20:30'\n",
      " '24:00' '24:00' '24:00' '24:00' '16:30' '24:00' '24:00' '24:00' '20:30'\n",
      " '24:00' '16:30' '24:00' '16:30' '24:00' '24:00' '24:00' '20:30' '16:30'\n",
      " '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '8:30' '24:00' '16:30'\n",
      " '24:00' '24:00' '24:00' '16:30' '16:30' '24:00' '16:30' '8:30' '24:00'\n",
      " '24:00' '16:30' '16:30' '24:00' '20:30' '20:30' None '24:00' '24:00'\n",
      " '24:00' '24:00' None '24:00' '20:30' '24:00' '8:30' '24:00' '8:30' '8:30'\n",
      " '24:00' '20:30' '24:00' '24:00' '24:00' '16:30' '20:30' '8:30' '24:00'\n",
      " '8:30' '24:00' '16:30' '20:30' '16:30' '8:30' '20:30' '16:30' '24:00'\n",
      " '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '16:30' '24:00' '16:30'\n",
      " '16:30' '24:00' '16:30' None '24:00' '20:30' '8:30' '16:30' '8:30'\n",
      " '20:30' '24:00' '24:00' '24:00' '20:30' '24:00' '20:30' '24:00' '20:30'\n",
      " '20:30' '24:00' '20:30' '20:30' '20:30' '16:30' '20:30' '20:30' '8:30'\n",
      " '16:30' '16:30' '16:30' '24:00' '24:00' '24:00' '16:30' '8:30' '24:00'\n",
      " '24:00' '16:30' '24:00']' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
      "  solution_out[\n"
     ]
    }
   ],
   "source": [
    "for d in range(1, 32):\n",
    "    time = pd.DataFrame()\n",
    "    # начало работы\n",
    "    time['start'] = pd.Series([None for _ in range(solution.shape[0])])\n",
    "    # конец работы\n",
    "    time['end'] = pd.Series([None for _ in range(solution.shape[0])])\n",
    "    for h in range(0, 24, 4):\n",
    "        tmp = solution[str(d)+'_'+str(h)]\n",
    "        f1 = lambda x: str(h)+':00' if x==1 else 'отпуск' if x==-1 else None\n",
    "        # 30 минут на перерыв\n",
    "        # по следующей логике заполняем\n",
    "        #если работа началась, то смотрим когда она заканчивается\n",
    "        #ищем последнюю 1 в строке дня, прибавляем 4 часа\n",
    "        f2 = lambda x: str(h+4)+':30' if x==1 and h<20 else str(h+4)+':00' if x==1 and h==20 else 'отпуск' if x==-1 else None\n",
    "        time['start'][time['start'].isnull()] = tmp.map(f1)[time['start'].isnull()]\n",
    "        tmp2 = pd.Series([None for _ in range(solution.shape[0])])\n",
    "        tmp2[time['start'].notnull()] = tmp.map(f2)[time['start'].notnull()]\n",
    "        time['end'][tmp2.notnull()]  = tmp2[tmp2.notnull()]\n",
    "    criteria = solution_out.loc[0] == d\n",
    "    solution_out[\n",
    "        criteria.index[criteria][0]\n",
    "    ][1::4][:len(time['start'])] = time['start']\n",
    "    solution_out[\n",
    "        criteria.index[criteria][0]\n",
    "    ][2::4][:len(time['end'])] = time['end']\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1        8:00\n",
       "5       16:00\n",
       "9        8:00\n",
       "13      16:00\n",
       "17       8:00\n",
       "        ...  \n",
       "1453    16:00\n",
       "1457     8:00\n",
       "1461    16:00\n",
       "1465    20:00\n",
       "1469    16:00\n",
       "Name: Unnamed: 37, Length: 368, dtype: object"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solution_out[\n",
    "        criteria.index[criteria][0]\n",
    "    ][1::4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       8:00\n",
       "1      16:00\n",
       "2       8:00\n",
       "3      16:00\n",
       "4       8:00\n",
       "       ...  \n",
       "363    16:00\n",
       "364     8:00\n",
       "365    16:00\n",
       "366    20:00\n",
       "367    16:00\n",
       "Name: start, Length: 368, dtype: object"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time['start']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# solution_out[\n",
    "#         criteria.index[criteria][0]\n",
    "#     ][1::4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# solution_out[criteria.index[criteria][0], range(1, solution_out.shape[0], 4)] = pd.DataFrame(time['start'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Фамилия,\\nИмя,\\nОтчество</th>\n",
       "      <th>Модальность</th>\n",
       "      <th>Дополнительные модальности</th>\n",
       "      <th>Ставка</th>\n",
       "      <th>Таб.\\n№</th>\n",
       "      <th>Unnamed: 5</th>\n",
       "      <th>Числа месяца</th>\n",
       "      <th>Unnamed: 7</th>\n",
       "      <th>Unnamed: 8</th>\n",
       "      <th>Unnamed: 9</th>\n",
       "      <th>...</th>\n",
       "      <th>Unnamed: 33</th>\n",
       "      <th>Unnamed: 34</th>\n",
       "      <th>Unnamed: 35</th>\n",
       "      <th>Unnamed: 36</th>\n",
       "      <th>Unnamed: 37</th>\n",
       "      <th>Unnamed: 38</th>\n",
       "      <th>Норма\\nчасов\\nпо\\nграфику</th>\n",
       "      <th>Норма\\nчасов за\\nполный\\nмесяц</th>\n",
       "      <th>Дата</th>\n",
       "      <th>Подпись</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>27</td>\n",
       "      <td>28.0</td>\n",
       "      <td>29</td>\n",
       "      <td>30.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>Итого за 2 пол. месяца</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Врач1</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ,ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>8:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>155.0</td>\n",
       "      <td>155.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>до</td>\n",
       "      <td>20:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>перерыв</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>30</td>\n",
       "      <td>...</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1468</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1469</th>\n",
       "      <td>Врач368</td>\n",
       "      <td>РГ</td>\n",
       "      <td>КТ, ММГ,ФЛГ, Денситометрия</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>с</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1470</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>до</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1471</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>перерыв</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1472</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>отраб.</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1473 rows × 43 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Фамилия,\\nИмя,\\nОтчество Модальность  Дополнительные модальности  Ставка  \\\n",
       "0                         NaN         NaN                         NaN     NaN   \n",
       "1                       Врач1          РГ   КТ,ММГ,ФЛГ, Денситометрия     1.0   \n",
       "2                         NaN         NaN                         NaN     NaN   \n",
       "3                         NaN         NaN                         NaN     NaN   \n",
       "4                         NaN         NaN                         NaN     NaN   \n",
       "...                       ...         ...                         ...     ...   \n",
       "1468                      NaN         NaN                         NaN     NaN   \n",
       "1469                  Врач368          РГ  КТ, ММГ,ФЛГ, Денситометрия     1.0   \n",
       "1470                      NaN         NaN                         NaN     NaN   \n",
       "1471                      NaN         NaN                         NaN     NaN   \n",
       "1472                      NaN         NaN                         NaN     NaN   \n",
       "\n",
       "      Таб.\\n№ Unnamed: 5 Числа месяца  Unnamed: 7  Unnamed: 8 Unnamed: 9  ...  \\\n",
       "0         NaN        NaN            1         2.0         3.0          4  ...   \n",
       "1         NaN          с         8:00         NaN         NaN       None  ...   \n",
       "2         NaN         до        20:30         NaN         NaN       None  ...   \n",
       "3         NaN    перерыв           30         NaN         NaN         30  ...   \n",
       "4         NaN     отраб.           12         NaN         NaN         12  ...   \n",
       "...       ...        ...          ...         ...         ...        ...  ...   \n",
       "1468      NaN     отраб.          NaN         NaN         NaN        NaN  ...   \n",
       "1469      NaN          с          NaN         NaN         NaN        NaN  ...   \n",
       "1470      NaN         до          NaN         NaN         NaN        NaN  ...   \n",
       "1471      NaN    перерыв          NaN         NaN         NaN        NaN  ...   \n",
       "1472      NaN     отраб.          NaN         NaN         NaN        NaN  ...   \n",
       "\n",
       "      Unnamed: 33 Unnamed: 34 Unnamed: 35  Unnamed: 36  Unnamed: 37  \\\n",
       "0              27        28.0          29         30.0         31.0   \n",
       "1            None         NaN        8:00          NaN          NaN   \n",
       "2            None         NaN       20:30          NaN          NaN   \n",
       "3              30         NaN          30          NaN          NaN   \n",
       "4              12         NaN          12          NaN          NaN   \n",
       "...           ...         ...         ...          ...          ...   \n",
       "1468          NaN         NaN         NaN          NaN          NaN   \n",
       "1469          NaN         NaN         NaN          NaN          NaN   \n",
       "1470          NaN         NaN         NaN          NaN          NaN   \n",
       "1471          NaN         NaN         NaN          NaN          NaN   \n",
       "1472          NaN         NaN         NaN          NaN          NaN   \n",
       "\n",
       "                 Unnamed: 38 Норма\\nчасов\\nпо\\nграфику  \\\n",
       "0     Итого за 2 пол. месяца                       NaN   \n",
       "1                        NaN                     155.0   \n",
       "2                        NaN                       NaN   \n",
       "3                        NaN                       NaN   \n",
       "4                       72.0                       NaN   \n",
       "...                      ...                       ...   \n",
       "1468                     NaN                       NaN   \n",
       "1469                     NaN                       NaN   \n",
       "1470                     NaN                       NaN   \n",
       "1471                     NaN                       NaN   \n",
       "1472                     NaN                       NaN   \n",
       "\n",
       "      Норма\\nчасов за\\nполный\\nмесяц Дата  Подпись  \n",
       "0                                NaN  NaN      NaN  \n",
       "1                              155.0  NaN      NaN  \n",
       "2                                NaN  NaN      NaN  \n",
       "3                                NaN  NaN      NaN  \n",
       "4                                NaN  NaN      NaN  \n",
       "...                              ...  ...      ...  \n",
       "1468                             NaN  NaN      NaN  \n",
       "1469                             NaN  NaN      NaN  \n",
       "1470                             NaN  NaN      NaN  \n",
       "1471                             NaN  NaN      NaN  \n",
       "1472                             NaN  NaN      NaN  \n",
       "\n",
       "[1473 rows x 43 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solution_out"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "solution_out.to_excel('solution_tabel_final.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
